MCPcopy
hub / github.com/bnb-chain/bsc / Snapshot

Method Snapshot

metrics/resetting_timer.go:100–109  ·  view source on GitHub ↗

Snapshot resets the timer and returns a read-only copy of its contents.

()

Source from the content-addressed store, hash-verified

98
99// Snapshot resets the timer and returns a read-only copy of its contents.
100func (t *StandardResettingTimer) Snapshot() ResettingTimer {
101 t.mutex.Lock()
102 defer t.mutex.Unlock()
103 currentValues := t.values
104 t.values = make([]int64, 0, InitialResettingTimerSliceCap)
105
106 return &ResettingTimerSnapshot{
107 values: currentValues,
108 }
109}
110
111// Percentiles panics.
112func (t *StandardResettingTimer) Percentiles([]float64) []int64 {

Callers

nothing calls this directly

Calls 2

LockMethod · 0.80
UnlockMethod · 0.45

Tested by

no test coverage detected