Merge pull request #392 from mishudark/patch-1
fix(generic.go): add defer to ApproximateMovingAverage mutext
Peter Bourgon authored 6 years ago
GitHub committed 6 years ago
207 | 207 |
// ApproximateMovingAverage returns the approximate moving average of observations.
|
208 | 208 |
func (h *SimpleHistogram) ApproximateMovingAverage() float64 {
|
209 | 209 |
h.mtx.RLock()
|
210 | |
h.mtx.RUnlock()
|
|
210 |
defer h.mtx.RUnlock()
|
211 | 211 |
return h.avg
|
212 | 212 |
}
|
213 | 213 |
|