Skip to content

Commit 04e0348

Browse files
authored
Update log.go
1 parent 18a9027 commit 04e0348

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

metrics/log.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ func LogScaled(r Registry, freq time.Duration, scale time.Duration, l Logger) {
1818
du := float64(scale)
1919
duSuffix := scale.String()[1:]
2020

21-
for range time.Tick(freq) {
21+
ticker := time.NewTicker(freq)
22+
defer ticker.Stop()
23+
24+
for range ticker.C {
2225
r.Each(func(name string, i interface{}) {
2326
switch metric := i.(type) {
2427
case *Counter:

0 commit comments

Comments
 (0)