MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestMergeIter

Function TestMergeIter

pkg/querier/batch/merge_test.go:14–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestMergeIter(t *testing.T) {
15 t.Parallel()
16 forEncodings(t, func(t *testing.T, enc encoding.Encoding) {
17 chunk1 := mkGenericChunk(t, 0, 100, enc)
18 chunk2 := mkGenericChunk(t, model.TimeFromUnix(25), 100, enc)
19 chunk3 := mkGenericChunk(t, model.TimeFromUnix(50), 100, enc)
20 chunk4 := mkGenericChunk(t, model.TimeFromUnix(75), 100, enc)
21 chunk5 := mkGenericChunk(t, model.TimeFromUnix(100), 100, enc)
22
23 iter := newMergeIterator(nil, []GenericChunk{chunk1, chunk2, chunk3, chunk4, chunk5})
24 testIter(t, 200, newIteratorAdapter(iter), enc)
25
26 iter = newMergeIterator(iter, []GenericChunk{chunk1, chunk2, chunk3, chunk4, chunk5})
27 testSeek(t, 200, newIteratorAdapter(iter), enc)
28 })
29}
30
31func BenchmarkMergeIterator(b *testing.B) {
32 chunks := make([]GenericChunk, 0, 10)

Callers

nothing calls this directly

Calls 6

forEncodingsFunction · 0.85
mkGenericChunkFunction · 0.85
newMergeIteratorFunction · 0.85
testIterFunction · 0.85
newIteratorAdapterFunction · 0.85
testSeekFunction · 0.85

Tested by

no test coverage detected