Example #1
0
func InitVlan() {
	Devices = consistent.New()
	for _, device := range g.Config.VLan.Physical {
		Devices.Add(device)
	}
	logs.Info("Vlan initiated")
}
Example #2
0
func InitTransfers() {
	Transfers = consistent.New()
	for _, transfer := range Config.Metrics.Transfers {
		Transfers.Add(transfer)
	}
	logs.Info("Metrics initiated")
}
Example #3
0
func NewVLanSetter() *VLanSetter {
	v := &VLanSetter{}
	v.Devices = consistent.New()
	for _, device := range config.VLan.Physical {
		v.Devices.Add(device)
	}
	return v
}
Example #4
0
func NewMetricsRecorder(hostname string, config defines.MetricsConfig) *MetricsRecorder {
	r := &MetricsRecorder{}
	r.hostname = hostname
	r.apps = map[string]struct{}{}
	r.transfers = consistent.New()
	r.step = time.Duration(config.Step) * time.Second
	r.rpcTimeout = time.Duration(config.Timeout) * time.Millisecond
	for _, transfer := range config.Transfers {
		r.transfers.Add(transfer)
	}
	return r
}
Example #5
0
func (s *Route) LoadBackends() {
	s.Backends = consistent.New()
	for _, addr := range s.Target.Addrs {
		s.Backends.Add(addr)
	}
}
Example #6
0
func InitTransfers() {
	Transfers = consistent.New()
	for _, transfer := range Config().Transfer.Addrs {
		Transfers.Add(transfer)
	}
}