Skip to content

Commit 5228a5c

Browse files
nonsensefirmianavan
authored andcommitted
metrics: return an empty snapshot for NilResettingTimer (ethereum#16930)
1 parent 3afc1ac commit 5228a5c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

metrics/resetting_timer.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ type NilResettingTimer struct {
5858
func (NilResettingTimer) Values() []int64 { return nil }
5959

6060
// Snapshot is a no-op.
61-
func (NilResettingTimer) Snapshot() ResettingTimer { return NilResettingTimer{} }
61+
func (NilResettingTimer) Snapshot() ResettingTimer {
62+
return &ResettingTimerSnapshot{
63+
values: []int64{},
64+
}
65+
}
6266

6367
// Time is a no-op.
6468
func (NilResettingTimer) Time(func()) {}

0 commit comments

Comments
 (0)