From e331197ccde8c68c40142d8903084380902a2d13 Mon Sep 17 00:00:00 2001 From: georgehao Date: Sun, 17 Mar 2024 21:33:04 +0800 Subject: [PATCH] feat: tweak a bit --- metrics/timer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metrics/timer.go b/metrics/timer.go index 9dac4f4505..c731aa67bd 100644 --- a/metrics/timer.go +++ b/metrics/timer.go @@ -99,14 +99,14 @@ func (t *StandardTimer) Stop() { t.meter.Stop() } -// Time Record the duration of the execution of the given function. +// Time record the duration of the execution of the given function. func (t *StandardTimer) Time(f func()) { ts := time.Now() f() t.Update(time.Since(ts)) } -// Update Record the duration of an event, in nanoseconds. +// Update record the duration of an event, in nanoseconds. func (t *StandardTimer) Update(d time.Duration) { t.mutex.Lock() defer t.mutex.Unlock() @@ -114,7 +114,7 @@ func (t *StandardTimer) Update(d time.Duration) { t.meter.Mark(1) } -// UpdateSince Record the duration of an event that started at a time and ends now. +// UpdateSince record the duration of an event that started at a time and ends now. // The record uses nanoseconds. func (t *StandardTimer) UpdateSince(ts time.Time) { t.Update(time.Since(ts))