Browse Source

Remove interval/timeout from Target internals

pull/1429/head
Fabian Reinartz 9 years ago
parent
commit
02f635dc24
  1. 2
      retrieval/scrape.go
  2. 14
      retrieval/target.go

2
retrieval/scrape.go

@ -165,7 +165,7 @@ func (sp *scrapePool) sync(tgroups map[string]map[model.Fingerprint]*Target) {
newTargets[fp] = tnew
tnew.scrapeLoop = newScrapeLoop(sp.ctx, tnew, sp.sampleAppender(tnew), sp.reportAppender(tnew))
go tnew.scrapeLoop.run(tnew.interval(), tnew.timeout(), nil)
go tnew.scrapeLoop.run(time.Duration(sp.config.ScrapeInterval), time.Duration(sp.config.ScrapeTimeout), nil)
}
}
for fp, told := range prevTargets {

14
retrieval/target.go

@ -229,20 +229,6 @@ func (t *Target) offset(interval time.Duration) time.Duration {
return time.Duration(next)
}
func (t *Target) interval() time.Duration {
t.RLock()
defer t.RUnlock()
return time.Duration(t.scrapeConfig.ScrapeInterval)
}
func (t *Target) timeout() time.Duration {
t.RLock()
defer t.RUnlock()
return time.Duration(t.scrapeConfig.ScrapeTimeout)
}
func (t *Target) scheme() string {
t.RLock()
defer t.RUnlock()

Loading…
Cancel
Save