Add comment on SampleRingIterator

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
This commit is contained in:
Filip Petkovski 2023-12-13 08:30:02 +01:00
parent 48df9fc020
commit bb8363dbb3
No known key found for this signature in database
GPG key ID: 431B0F2E85E42402
2 changed files with 3 additions and 14 deletions

View file

@ -2114,12 +2114,7 @@ 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})
}
floats = append(floats, FPoint{T: t, F: f})
}
}
}

View file

@ -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
}