Update log.go

This commit is contained in:
maradini77 2025-11-01 12:09:33 +01:00 committed by GitHub
parent 18a902799e
commit 04e034850f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: