Procházet zdrojové kódy

fix(metrics): default updateSince to ms

bergquist před 9 roky
rodič
revize
3c9432b7e9
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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) {
 func (t *StandardTimer) UpdateSince(ts time.Time) {
 	t.mutex.Lock()
 	t.mutex.Lock()
 	defer t.mutex.Unlock()
 	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)
 	t.meter.Mark(1)
 }
 }