Skip to content

Commit

Permalink
fix: explain why we ignore small time deltas
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Nov 11, 2023
1 parent 494ae6b commit e2267a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sweeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ func (sw *sweeper) update() {
}
return
} else if tdiff <= ewmaRate/10 {
// If the time-delta is too small, wait a bit. Otherwise, we can end up logging a
// very large spike.
//
// This won't fix the case where a user passes a large update (spanning multiple
// seconds) to `Meter.Mark`, but it will fix the case where the system fails to
// accurately schedule the sweeper goroutine.
return
}

Expand Down

0 comments on commit e2267a1

Please # to comment.