From bddaf229c03ea8111ee7d19817f2c5ebcf752b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Fri, 14 Jul 2023 19:10:16 +0300 Subject: [PATCH] metrics: NilTimer should still run the function to be timed (#27723) --- metrics/timer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics/timer.go b/metrics/timer.go index a63c9dfb6c2da..2e1a9be47295f 100644 --- a/metrics/timer.go +++ b/metrics/timer.go @@ -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) {}