Skip to content

Commit

Permalink
Warn when generating the report takes too long.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Wilkie committed Sep 8, 2015
1 parent d0082e9 commit df97978
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions probe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func main() {
r = report.MakeReport()

case <-spyTick:
start := time.Now()
if err := processCache.Update(); err != nil {
log.Printf("error reading processes: %v", err)
}
Expand All @@ -191,6 +192,10 @@ func main() {
}
r = Apply(r, taggers)

if elapsed := time.Now().Sub(start); elapsed > *spyInterval {
log.Printf("Warning: Took %s to generate report - longer than spyInterval of %s.", elapsed, *spyInterval)
}

case <-quit:
return
}
Expand Down

0 comments on commit df97978

Please sign in to comment.