Skip to content

Commit 888c7e9

Browse files
authored
Merge pull request #443 from OffchainLabs/metrics
Add metrics enabled check to SlidingTimeWindowArraySample
2 parents 084f638 + 61a308a commit 888c7e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

metrics/sliding_time_window_array_sample.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ func (s *SlidingTimeWindowArraySample) Snapshot() *sampleSnapshot {
104104

105105
// Update samples a new value.
106106
func (s *SlidingTimeWindowArraySample) Update(v int64) {
107+
if !metricsEnabled {
108+
return
109+
}
107110
s.mutex.Lock()
108111
defer s.mutex.Unlock()
109112
var newTick int64

0 commit comments

Comments
 (0)