in metrics/testutil/metrics.go [358:377]
func (hist *Histogram) Validate() error {
if hist.SampleCount == nil || hist.GetSampleCount() == 0 {
return fmt.Errorf("nil or empty histogram SampleCount")
}
if hist.SampleSum == nil || hist.GetSampleSum() == 0 {
return fmt.Errorf("nil or empty histogram SampleSum")
}
for _, bckt := range hist.Bucket {
if bckt == nil {
return fmt.Errorf("empty histogram bucket")
}
if bckt.UpperBound == nil || bckt.GetUpperBound() < 0 {
return fmt.Errorf("nil or negative histogram bucket UpperBound")
}
}
return nil
}