mirror of https://github.com/prometheus/prometheus
Add comment on SampleRingIterator
Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>pull/13276/head
parent
48df9fc020
commit
bb8363dbb3
|
@ -2114,15 +2114,10 @@ loop:
|
|||
if floats == nil {
|
||||
floats = getFPointSlice(16)
|
||||
}
|
||||
if n := len(floats); n < cap(floats) {
|
||||
floats = floats[:n+1]
|
||||
floats[n].T, floats[n].F = t, f
|
||||
} else {
|
||||
floats = append(floats, FPoint{T: t, F: f})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// The sought sample might also be in the range.
|
||||
switch soughtValueType {
|
||||
case chunkenc.ValFloatHistogram, chunkenc.ValHistogram:
|
||||
|
|
|
@ -310,6 +310,8 @@ func (r *sampleRing) iterator() *SampleRingIterator {
|
|||
return &r.it
|
||||
}
|
||||
|
||||
// SampleRingIterator is returned by BufferedSeriesIterator.Buffer() and can be
|
||||
// used to iterate samples buffered in the lookback window.
|
||||
type SampleRingIterator struct {
|
||||
r *sampleRing
|
||||
i int
|
||||
|
@ -358,14 +360,6 @@ func (it *SampleRingIterator) Next() chunkenc.ValueType {
|
|||
}
|
||||
}
|
||||
|
||||
func (it *SampleRingIterator) Seek(int64) chunkenc.ValueType {
|
||||
return chunkenc.ValNone
|
||||
}
|
||||
|
||||
func (it *SampleRingIterator) Err() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (it *SampleRingIterator) At() (int64, float64) {
|
||||
return it.t, it.f
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue