func(m *Manager)updater(ctx context.Context, p *provider, updates chan[]*targetgroup.Group){for{select{case<-ctx.Done():returncase tgs, ok :=<-updates:
receivedUpdates.WithLabelValues(m.name).Inc()if!ok {
level.Debug(m.logger).Log("msg","Discoverer channel closed","provider", p.name)return}for_, s :=range p.subs {
m.updateGroup(poolKey{setName: s, provider: p.name}, tgs)}select{case m.triggerSend <-struct{}{}:default:}}}}
调用 更新对象到target map中
func(m *Manager)updateGroup(poolKey poolKey, tgs []*targetgroup.Group){
m.mtx.Lock()defer m.mtx.Unlock()if_, ok := m.targets[poolKey];!ok {
m.targets[poolKey]=make(map[string]*targetgroup.Group)}for_, tg :=range tgs {if tg !=nil{// Some Discoverers send nil target group so need to check for it to avoid panics.
m.targets[poolKey][tg.Source]= tg
}}}
{// Scrape manager.
g.Add(func()error{// When the scrape manager receives a new targets list// it needs to read a valid config for each job.// It depends on the config being in sync with the discovery manager so// we wait until the config is fully loaded.<-reloadReady.C
err := scrapeManager.Run(discoveryManagerScrape.SyncCh())
level.Info(logger).Log("msg","Scrape manager stopped")return err
},func(err error){// Scrape manager needs to be stopped before closing the local TSDB// so that it doesn't try to write samples to a closed storage.
level.Info(logger).Log("msg","Stopping scrape manager...")
scrapeManager.Stop()},)}
Copyright?2001-2004 International Business Machines Corp. Guidelines Eclipse 用户界面指南 2.1 版
查看目录 作者:Nick Edgar, Kevin Haaland, Jin Li , Kimberley Peter
译者:Bobbie Wang,Qi Liang
最新更新: 2004年2月
注意
您…
上一篇文章讲了使用Pushgateway收集业务数据的方法,今天讲另外一种方式textfile collector The textfile collector is similar to the Pushgateway, in that it allows exporting of statistics from batch jobs. The Pushgateway should be used for service-leve…
文章介绍了ZohoPeople、北森、i人事等六款主流人力资源管理系统,涵盖招聘、培训、考勤等功能,各有特点,适合不同规模企业需求。建议企业试用后选择,提高管理效率。 一、Zoho People
Zoho People是一款强大的云端人力资源管理系统…
今天的示例有点超出我的想象,首先会科普下WGSL这种新的着色器脚本,然后说说示例《Liquid Raymarching Scene with Three.js Shading Language | Codrops (tympanus.net)》的技术流程。本示例最终呈现的效果如下。可以看到他跟QQ那个消息拖拽消灭的效果非…