diff --git a/metrics/timer.go b/metrics/timer.go index 52aa5ae..e12d9cd 100644 --- a/metrics/timer.go +++ b/metrics/timer.go @@ -29,7 +29,8 @@ t.h.Observe(d) } -// Unit sets the timer time unit +// Unit sets the unit of the float64 emitted by the timer. +// By default, the timer emits seconds. func (t *Timer) Unit(u time.Duration) { t.u = u } diff --git a/metrics/timer_test.go b/metrics/timer_test.go index 1e08408..2743e99 100644 --- a/metrics/timer_test.go +++ b/metrics/timer_test.go @@ -33,7 +33,6 @@ } func TestTimerUnit(t *testing.T) { - for _, tc := range []struct { name string unit time.Duration