MCPcopy
hub / github.com/prometheus/prometheus / chainSampleIterator

Struct chainSampleIterator

storage/merge.go:476–486  ·  view source on GitHub ↗

chainSampleIterator is responsible to iterate over samples from different iterators of the same time series in timestamps order. If one or more samples overlap, one sample from random overlapped ones is kept and all others with the same timestamp are dropped. It's optimized for non-overlap cases as

Source from the content-addressed store, hash-verified

474// order. If one or more samples overlap, one sample from random overlapped ones is kept and all others with the same
475// timestamp are dropped. It's optimized for non-overlap cases as well.
476type chainSampleIterator struct {
477 iterators []chunkenc.Iterator
478 h samplesIteratorHeap
479
480 curr chunkenc.Iterator
481 lastT int64
482
483 // Whether the previous and the current sample are direct neighbors
484 // within the same base iterator.
485 consecutive bool
486}
487
488// Return a chainSampleIterator initialized for length entries, re-using the memory from it if possible.
489func getChainSampleIterator(it chunkenc.Iterator, length int) *chainSampleIterator {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected