Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
simpler runOnce logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcz committed May 31, 2021
1 parent 776fbeb commit d6b7c64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ func (s *Scraper) Start(ctx context.Context) error {
}

func (s *Scraper) runOnce() {
result := "fail"
if s.scrape() {
scrapeCounter.WithLabelValues("ok").Inc()
} else {
scrapeCounter.WithLabelValues("fail").Inc()
result = "ok"
}
scrapeCounter.WithLabelValues(result).Inc()
}

func (s *Scraper) scrape() bool {
Expand Down

0 comments on commit d6b7c64

Please sign in to comment.