From 60e6362c46fc1549a781b4ecaa1ef46485421694 Mon Sep 17 00:00:00 2001 From: sashaodessa <140454972+sashaodessa@users.noreply.github.com> Date: Tue, 21 Oct 2025 15:28:38 +0200 Subject: [PATCH] Update log.go --- metrics/log.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/metrics/log.go b/metrics/log.go index 08f3effb81..8034ece05c 100644 --- a/metrics/log.go +++ b/metrics/log.go @@ -18,7 +18,10 @@ func LogScaled(r Registry, freq time.Duration, scale time.Duration, l Logger) { du := float64(scale) duSuffix := scale.String()[1:] - for range time.Tick(freq) { + ticker := time.NewTicker(freq) + defer ticker.Stop() + + for range ticker.C { r.Each(func(name string, i interface{}) { switch metric := i.(type) { case *Counter: