MCPcopy
hub / github.com/prometheus/prometheus / NewBufferIterator

Function NewBufferIterator

storage/buffer.go:47–55  ·  view source on GitHub ↗

NewBufferIterator returns a new iterator that buffers the values within the time range of the current element and the duration of delta before.

(it chunkenc.Iterator, delta int64)

Source from the content-addressed store, hash-verified

45// NewBufferIterator returns a new iterator that buffers the values within the
46// time range of the current element and the duration of delta before.
47func NewBufferIterator(it chunkenc.Iterator, delta int64) *BufferedSeriesIterator {
48 bit := &BufferedSeriesIterator{
49 buf: newSampleRing(delta, 0, chunkenc.ValNone),
50 delta: delta,
51 }
52 bit.Reset(it)
53
54 return bit
55}
56
57// Reset re-uses the buffer with a new iterator, resetting the buffered time
58// delta to its original value.

Calls 2

ResetMethod · 0.95
newSampleRingFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…