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

Method AtFloatHistogram

pkg/querier/batch/batch.go:167–174  ·  view source on GitHub ↗

AtFloatHistogram implements chunkenc.Iterator.

(h *histogram.FloatHistogram)

Source from the content-addressed store, hash-verified

165
166// AtFloatHistogram implements chunkenc.Iterator.
167func (a *iteratorAdapter) AtFloatHistogram(h *histogram.FloatHistogram) (int64, *histogram.FloatHistogram) {
168 // PromQL engine always selects float histogram in its implementation so might call AtFloatHistogram
169 // even if it is a histogram. https://github.com/prometheus/prometheus/blob/v2.53.0/promql/engine.go#L2276
170 if a.curr.ValType == chunkenc.ValHistogram {
171 return a.curr.Timestamps[a.curr.Index], a.curr.Histograms[a.curr.Index].ToFloat(h)
172 }
173 return a.curr.Timestamps[a.curr.Index], a.curr.FloatHistograms[a.curr.Index]
174}
175
176// AtT implements chunkenc.Iterator.
177func (a *iteratorAdapter) AtT() int64 {

Callers 4

testIterFunction · 0.45
testSeekFunction · 0.45

Calls

no outgoing calls

Tested by 4

testIterFunction · 0.36
testSeekFunction · 0.36