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.
()
| 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. |
| 106 | func (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. |
| 130 | func (b *MemoizedSeriesIterator) At() (int64, float64) { |
no test coverage detected