MCPcopy
hub / github.com/prometheus/prometheus / Next

Method Next

storage/memoized_iterator.go:106–127  ·  view source on GitHub ↗

Next advances the iterator to the next element. Note that this does not check whether the element being buffered is within the time range of the current element and the duration of delta before.

()

Source from the content-addressed store, hash-verified

104// Next advances the iterator to the next element. Note that this does not check whether the element being buffered is
105// within the time range of the current element and the duration of delta before.
106func (b *MemoizedSeriesIterator) Next() chunkenc.ValueType {
107 // Keep track of the previous element.
108 switch b.valueType {
109 case chunkenc.ValNone:
110 return chunkenc.ValNone
111 case chunkenc.ValFloat:
112 b.prevTime, b.prevValue = b.it.At()
113 b.prevFloatHistogram = nil
114 case chunkenc.ValHistogram, chunkenc.ValFloatHistogram:
115 b.prevValue = 0
116 b.prevTime, b.prevFloatHistogram = b.it.AtFloatHistogram(nil)
117 }
118
119 b.valueType = b.it.Next()
120 if b.valueType != chunkenc.ValNone {
121 b.lastTime = b.it.AtT()
122 }
123 if b.valueType == chunkenc.ValHistogram {
124 b.valueType = chunkenc.ValFloatHistogram
125 }
126 return b.valueType
127}
128
129// At returns the current float element of the iterator.
130func (b *MemoizedSeriesIterator) At() (int64, float64) {

Callers 1

SeekMethod · 0.95

Calls 4

AtMethod · 0.65
AtFloatHistogramMethod · 0.65
NextMethod · 0.65
AtTMethod · 0.65

Tested by

no test coverage detected