metrics: reset internal value slice in Clear (#34761)

This commit is contained in:
cui 2026-04-21 19:58:49 +08:00 committed by GitHub
parent ac406c2fe7
commit 077d83387a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -314,7 +314,7 @@ func (s *UniformSample) Clear() {
s.mutex.Lock()
defer s.mutex.Unlock()
s.count = 0
clear(s.values)
s.values = s.values[:0]
}
// Snapshot returns a read-only copy of the sample.