Update comment for scheduler_behind_seconds metric (#45918)
This commit is contained in:
@@ -369,9 +369,9 @@ func (sch *schedule) schedulePeriodic(ctx context.Context) error {
|
|||||||
select {
|
select {
|
||||||
case tick := <-sch.ticker.C:
|
case tick := <-sch.ticker.C:
|
||||||
// We use Round(0) on the start time to remove the monotonic clock.
|
// 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
|
// This is required as ticks from the ticker and time.Now() can have
|
||||||
// timestamps such that start.Sub(tick) does not return the expected
|
// a monotonic clock that when subtracted do not represent the delta
|
||||||
// delta.
|
// in wall clock time.
|
||||||
start := time.Now().Round(0)
|
start := time.Now().Round(0)
|
||||||
sch.metrics.BehindSeconds.Set(start.Sub(tick).Seconds())
|
sch.metrics.BehindSeconds.Set(start.Sub(tick).Seconds())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user