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

Function seriesSetFromResponseStream

pkg/ingester/ingester_test.go:107–127  ·  view source on GitHub ↗
(s *mockQueryStreamServer)

Source from the content-addressed store, hash-verified

105}
106
107func seriesSetFromResponseStream(s *mockQueryStreamServer) (storage.SeriesSet, error) {
108 serieses := make([]storage.Series, 0, len(s.series))
109
110 for _, result := range s.series {
111 ls := cortexpb.FromLabelAdaptersToLabels(result.Labels)
112
113 chunks, err := chunkcompat.FromChunks(ls, result.Chunks)
114 if err != nil {
115 return nil, err
116 }
117
118 serieses = append(serieses, &storage.SeriesEntry{
119 Lset: ls,
120 SampleIteratorFn: func(it chunkenc.Iterator) chunkenc.Iterator {
121 return batch.NewChunkMergeIterator(it, chunks, math.MinInt64, math.MaxInt64)
122 },
123 })
124 }
125 set := series.NewConcreteSeriesSet(false, serieses)
126 return set, nil
127}
128
129func TestMatcherCache(t *testing.T) {
130 limits := defaultLimitsTestConfig()

Calls 4

FromChunksFunction · 0.92
NewChunkMergeIteratorFunction · 0.92
NewConcreteSeriesSetFunction · 0.92

Tested by

no test coverage detected