Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 58a3f5d

Browse files
committed
Don't lose HDR's errors.
1 parent 0d0c293 commit 58a3f5d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

metrics.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,13 @@ type Histogram struct {
135135
rw sync.RWMutex
136136
}
137137

138-
// RecordValue records the given value.
139-
func (h *Histogram) RecordValue(v int64) {
138+
// RecordValue records the given value, or returns an error if the value is out
139+
// of range.
140+
func (h *Histogram) RecordValue(v int64) error {
140141
h.rw.Lock()
141142
defer h.rw.Unlock()
142143

143-
h.hist.Current.RecordValue(v)
144+
return h.hist.Current.RecordValue(v)
144145
}
145146

146147
func (h *Histogram) rotate() {

0 commit comments

Comments
 (0)