本文整理匯總了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()
}