Fix lock semantics on Summary#Reset.
This erroneously used the read lock as opposed to the write lock. Change-Id: Ib127f8c117a516709eff9fd927603879501089b4
This commit is contained in:
parent
7efd34a6f8
commit
e782194166
|
@ -300,8 +300,8 @@ func (h *histogram) Purge() {
|
|||
func (h *histogram) Reset(labels map[string]string) {
|
||||
signature := labelValuesToSignature(labels)
|
||||
|
||||
h.mutex.RLock()
|
||||
defer h.mutex.RUnlock()
|
||||
h.mutex.Lock()
|
||||
defer h.mutex.Unlock()
|
||||
|
||||
value, ok := h.values[signature]
|
||||
|
||||
|
@ -312,6 +312,7 @@ func (h *histogram) Reset(labels map[string]string) {
|
|||
for _, bucket := range value.buckets {
|
||||
bucket.Reset()
|
||||
}
|
||||
|
||||
delete(h.values, signature)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue