metrics: NilResettingTimer.Time should execute the timed function (#27724)

This commit is contained in:
Daniel Liu 2024-12-13 14:00:13 +08:00
parent 51e49a869d
commit d43f6c0cb0

View file

@ -62,7 +62,7 @@ func (NilResettingTimer) Values() []int64 { return nil }
func (NilResettingTimer) Snapshot() ResettingTimer { return NilResettingTimer{} }
// Time is a no-op.
func (NilResettingTimer) Time(func()) {}
func (NilResettingTimer) Time(f func()) { f() }
// Update is a no-op.
func (NilResettingTimer) Update(time.Duration) {}