From e4073f31226bbc00799dc02009c202cc3e58032f Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Mon, 28 Feb 2022 15:35:11 -0600 Subject: [PATCH] Don't load initial crawler data When crawler is starting, it will send an event once data is loaded, and this is the best time to load more data, or else, load more after every crawl cycle. Until then, metrics will be null and prom will just skip the timeframe --- internal/metrics/crawler.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/metrics/crawler.go b/internal/metrics/crawler.go index d90bcbf..e8a1fea 100644 --- a/internal/metrics/crawler.go +++ b/internal/metrics/crawler.go @@ -70,11 +70,8 @@ func (s *CrawlerServiceMetrics) initMaxmindDB() error { return nil } -// InitialData is called on startup of the metrics server, to allow seeding metrics with -// current/initial data -func (s *CrawlerServiceMetrics) InitialData() { - utils.LogErr(s.metrics.client.CrawlerService.GetPeerCounts()) -} +// InitialData is called on startup of the metrics server, to allow seeding metrics with current/initial data +func (s *CrawlerServiceMetrics) InitialData() {} // ReceiveResponse handles crawler responses that are returned over the websocket func (s *CrawlerServiceMetrics) ReceiveResponse(resp *types.WebsocketResponse) {