Explorar o código

fix(metrics): default updateSince to ms

bergquist %!s(int64=9) %!d(string=hai) anos
pai
achega
3c9432b7e9
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      pkg/metrics/timer.go

+ 2 - 1
pkg/metrics/timer.go

@@ -222,7 +222,8 @@ func (t *StandardTimer) Update(d time.Duration) {
 func (t *StandardTimer) UpdateSince(ts time.Time) {
 	t.mutex.Lock()
 	defer t.mutex.Unlock()
-	t.histogram.Update(int64(time.Since(ts)))
+	sinceMs := time.Since(ts) / time.Millisecond
+	t.histogram.Update(int64(sinceMs))
 	t.meter.Mark(1)
 }