func (this *WatchConsumers) Init(ctx monitor.Context) { this.Zkzone = ctx.ZkZone() this.Stop = ctx.StopChan() this.Wg = ctx.Inflight() this.logFrequentConsumer = false this.offsetMtimeMap = make(map[structs.GroupTopicPartition]time.Time, 100) }
func (this *WatchActord) Init(ctx monitor.Context) { this.Zkzone = ctx.ZkZone() this.Stop = ctx.StopChan() this.Wg = ctx.Inflight() b, err := this.Zkzone.KatewayJobClusterConfig() if err != nil { log.Error(err) return } var mcc = &config.ConfigMysql{} if err = mcc.From(b); err != nil { log.Error(err) return } this.mc = mysql.New(mcc) manager.Default = dummy.New("") }
func (this *WatchQps) Init(ctx monitor.Context) { this.Zkzone = ctx.ZkZone() this.Stop = ctx.StopChan() this.Wg = ctx.Inflight() conf := &anomalyzer.AnomalyzerConf{ Sensitivity: 0.1, UpperBound: 5, LowerBound: 0, ActiveSize: 1, NSeasons: 4, Methods: []string{"diff", "fence", "highrank", "lowrank", "magnitude"}, } var err error this.anomaly, err = anomalyzer.NewAnomalyzer(conf, nil) if err != nil { panic(err) } }
func (this *WatchExec) Init(ctx monitor.Context) { this.Stop = ctx.StopChan() this.Wg = ctx.Inflight() this.confDir = ctx.ExternalDir() }
func (this *WatchInfluxServer) Init(ctx monitor.Context) { this.Zkzone = ctx.ZkZone() this.Stop = ctx.StopChan() this.Wg = ctx.Inflight() this.addr = ctx.InfluxAddr() }
func (this *WatchRedisInfo) Init(ctx monitor.Context) { this.Zkzone = ctx.ZkZone() this.Stop = ctx.StopChan() this.Wg = ctx.Inflight() }
func (this *WatchSub) Init(ctx monitor.Context) { this.Zkzone = ctx.ZkZone() this.Stop = ctx.StopChan() this.Wg = ctx.Inflight() this.suspects = make(map[structs.GroupTopicPartition]subStatus) }
func (this *WatchLoadAvg) Init(ctx monitor.Context) { this.Stop = ctx.StopChan() this.Wg = ctx.Inflight() }