mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-30 15:22:07 +00:00
lib/promscrape: properly track the number of updated service discovery routines inside Config.mustRestart()
This is a follow-up for d5a599badc
This commit is contained in:
parent
b3bcf99cea
commit
af6dc9c963
1 changed files with 6 additions and 5 deletions
|
@ -187,12 +187,13 @@ func (cfg *Config) mustRestart(prevCfg *Config) bool {
|
|||
}
|
||||
jobNames := cfg.getJobNames()
|
||||
tsmGlobal.registerJobNames(jobNames)
|
||||
hasChanges := started > 0 || stopped > 0 || restarted > 0
|
||||
if hasChanges {
|
||||
logger.Infof("updated %d service discovery routines in %.3f seconds, started=%d, stopped=%d, restarted=%d",
|
||||
len(cfg.ScrapeConfigs), time.Since(startTime).Seconds(), started, stopped, restarted)
|
||||
updated := started + stopped + restarted
|
||||
if updated == 0 {
|
||||
return false
|
||||
}
|
||||
return hasChanges
|
||||
logger.Infof("updated %d service discovery routines in %.3f seconds, started=%d, stopped=%d, restarted=%d",
|
||||
updated, time.Since(startTime).Seconds(), started, stopped, restarted)
|
||||
return true
|
||||
}
|
||||
|
||||
func areEqualGlobalConfigs(a, b *GlobalConfig) bool {
|
||||
|
|
Loading…
Reference in a new issue