MCPcopy
hub / github.com/prometheus/prometheus / ExpandSamples

Function ExpandSamples

storage/series.go:452–454  ·  view source on GitHub ↗

ExpandSamples iterates over all samples in the iterator, buffering all in slice. Optionally it takes samples constructor, useful when you want to compare sample slices with different sample implementations. if nil, sample type from this package will be used. For float sample, NaN values are replaced

(iter chunkenc.Iterator, newSampleFn func(st, t int64, f float64, h *histogram.Histogram, fh *histogram.FloatHistogram) chunks.Sample)

Source from the content-addressed store, hash-verified

450// sample implementations. if nil, sample type from this package will be used.
451// For float sample, NaN values are replaced with -42.
452func ExpandSamples(iter chunkenc.Iterator, newSampleFn func(st, t int64, f float64, h *histogram.Histogram, fh *histogram.FloatHistogram) chunks.Sample) ([]chunks.Sample, error) {
453 return expandSamples(iter, true, newSampleFn)
454}
455
456// ExpandSamplesWithoutReplacingNaNs is same as ExpandSamples but it does not replace float sample NaN values with anything.
457func ExpandSamplesWithoutReplacingNaNs(iter chunkenc.Iterator, newSampleFn func(st, t int64, f float64, h *histogram.Histogram, fh *histogram.FloatHistogram) chunks.Sample) ([]chunks.Sample, error) {

Callers 15

testBlockQuerierFunction · 0.92
queryHelperFunction · 0.92
queryAndExpandChunksFunction · 0.92
TestDeleteSimpleFunction · 0.92
TestDB_e2eFunction · 0.92
TestTombstoneCleanFunction · 0.92
testChunkQuerierOOOQueryFunction · 0.92
testWBLAndMmapReplayFunction · 0.92

Calls 1

expandSamplesFunction · 0.85

Tested by 15

testBlockQuerierFunction · 0.74
queryHelperFunction · 0.74
queryAndExpandChunksFunction · 0.74
TestDeleteSimpleFunction · 0.74
TestDB_e2eFunction · 0.74
TestTombstoneCleanFunction · 0.74
testChunkQuerierOOOQueryFunction · 0.74
testWBLAndMmapReplayFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…