Update comment for scheduler_behind_seconds metric (#45918) (#45919)

(cherry picked from commit f87bfdf2ff)

Co-authored-by: George Robinson <george.robinson@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2022-02-25 15:54:42 +01:00
committed by GitHub
co-authored by George Robinson
parent 6ea6c611a9
commit 87edde2b38
+3 -3
View File
@@ -369,9 +369,9 @@ func (sch *schedule) schedulePeriodic(ctx context.Context) error {
select {
case tick := <-sch.ticker.C:
// We use Round(0) on the start time to remove the monotonic clock.
// This is required as late ticks from the ticker have current monotonic
// timestamps such that start.Sub(tick) does not return the expected
// delta.
// This is required as ticks from the ticker and time.Now() can have
// a monotonic clock that when subtracted do not represent the delta
// in wall clock time.
start := time.Now().Round(0)
sch.metrics.BehindSeconds.Set(start.Sub(tick).Seconds())