Skip to content

Commit

Permalink
Merge pull request #392 from mishudark/patch-1
Browse files Browse the repository at this point in the history
fix(generic.go): add defer to ApproximateMovingAverage mutext
  • Loading branch information
peterbourgon authored Nov 15, 2016
2 parents 9f5c614 + 4fd567d commit f66b0e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metrics/generic/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (h *SimpleHistogram) Observe(value float64) {
// ApproximateMovingAverage returns the approximate moving average of observations.
func (h *SimpleHistogram) ApproximateMovingAverage() float64 {
h.mtx.RLock()
h.mtx.RUnlock()
defer h.mtx.RUnlock()
return h.avg
}

Expand Down

0 comments on commit f66b0e1

Please sign in to comment.