MCPcopy Create free account
hub / github.com/cortexproject/cortex / BucketCount

Method BucketCount

pkg/cortexpb/histograms.go:166–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

164}
165
166func (h Histogram) BucketCount() int {
167 count := 0
168 if h.IsFloatHistogram() {
169 count = len(h.PositiveCounts) + len(h.NegativeCounts)
170 if h.GetZeroCountFloat() > 0 {
171 count++
172 }
173 } else {
174 count = len(h.PositiveDeltas) + len(h.NegativeDeltas)
175 if h.GetZeroCountInt() > 0 {
176 count++
177 }
178 }
179 return count
180}
181
182// MaxWrappedHistogramSizeBytes is the maximum allowed size of a single native histogram in raw protobuf
183// bytes before unmarshalling. A value of 0 disables the limit.

Callers 1

PushMethod · 0.80

Calls 3

IsFloatHistogramMethod · 0.95
GetZeroCountFloatMethod · 0.95
GetZeroCountIntMethod · 0.95

Tested by

no test coverage detected