From 02f635dc241f7de0cf99ee3af954bd2e764ec3a3 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Tue, 23 Feb 2016 12:06:08 +0100 Subject: [PATCH] Remove interval/timeout from Target internals --- retrieval/scrape.go | 2 +- retrieval/target.go | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/retrieval/scrape.go b/retrieval/scrape.go index 9c52e6e1e..7f27d2d15 100644 --- a/retrieval/scrape.go +++ b/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 { diff --git a/retrieval/target.go b/retrieval/target.go index 0074b6e2d..81d3e1bd8 100644 --- a/retrieval/target.go +++ b/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()