metrics: NilTimer should still run the function to be timed (#27723)

This commit is contained in:
Ömer Faruk Irmak 2023-07-14 19:10:16 +03:00 committed by devopsbo3
parent da8b8ed315
commit 5ad2a03ca1

View file

@ -123,7 +123,7 @@ func (NilTimer) Stop() {}
func (NilTimer) Sum() int64 { return 0 }
// Time is a no-op.
func (NilTimer) Time(func()) {}
func (NilTimer) Time(f func()) { f() }
// Update is a no-op.
func (NilTimer) Update(time.Duration) {}