本文整理汇总了Golang中github.com/funkygao/gafka/cmd/kguard/monitor.Context类的典型用法代码示例。如果您正苦于以下问题:Golang Context类的具体用法?Golang Context怎么用?Golang Context使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Context类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Init
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)
}
示例2: Init
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("")
}
示例3: Init
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)
}
}
示例4: Init
func (this *WatchExec) Init(ctx monitor.Context) {
this.Stop = ctx.StopChan()
this.Wg = ctx.Inflight()
this.confDir = ctx.ExternalDir()
}
示例5: Init
func (this *WatchInfluxServer) Init(ctx monitor.Context) {
this.Zkzone = ctx.ZkZone()
this.Stop = ctx.StopChan()
this.Wg = ctx.Inflight()
this.addr = ctx.InfluxAddr()
}
示例6: Init
func (this *WatchRedisInfo) Init(ctx monitor.Context) {
this.Zkzone = ctx.ZkZone()
this.Stop = ctx.StopChan()
this.Wg = ctx.Inflight()
}
示例7: Init
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)
}
示例8: Init
func (this *WatchLoadAvg) Init(ctx monitor.Context) {
this.Stop = ctx.StopChan()
this.Wg = ctx.Inflight()
}