Exemple #1
0
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)
}
Exemple #2
0
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("")
}
Exemple #3
0
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)
	}
}
Exemple #4
0
func (this *WatchExec) Init(ctx monitor.Context) {
	this.Stop = ctx.StopChan()
	this.Wg = ctx.Inflight()
	this.confDir = ctx.ExternalDir()
}
Exemple #5
0
func (this *WatchInfluxServer) Init(ctx monitor.Context) {
	this.Zkzone = ctx.ZkZone()
	this.Stop = ctx.StopChan()
	this.Wg = ctx.Inflight()
	this.addr = ctx.InfluxAddr()
}
Exemple #6
0
func (this *WatchRedisInfo) Init(ctx monitor.Context) {
	this.Zkzone = ctx.ZkZone()
	this.Stop = ctx.StopChan()
	this.Wg = ctx.Inflight()
}
Exemple #7
0
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)
}
Exemple #8
0
func (this *WatchLoadAvg) Init(ctx monitor.Context) {
	this.Stop = ctx.StopChan()
	this.Wg = ctx.Inflight()
}