Remove interval/timeout from Target internals

pull/1429/head
Fabian Reinartz 9 years ago
parent 775316f8d2
commit 02f635dc24

@ -165,7 +165,7 @@ func (sp *scrapePool) sync(tgroups map[string]map[model.Fingerprint]*Target) {
newTargets[fp] = tnew newTargets[fp] = tnew
tnew.scrapeLoop = newScrapeLoop(sp.ctx, tnew, sp.sampleAppender(tnew), sp.reportAppender(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 { for fp, told := range prevTargets {

@ -229,20 +229,6 @@ func (t *Target) offset(interval time.Duration) time.Duration {
return time.Duration(next) 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 { func (t *Target) scheme() string {
t.RLock() t.RLock()
defer t.RUnlock() defer t.RUnlock()

Loading…
Cancel
Save