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

Function createAggrChunk

pkg/querier/blocks_store_queryable_test.go:2973–2991  ·  view source on GitHub ↗
(t *testing.T, step time.Duration, from model.Time, points int, enc encoding.Encoding)

Source from the content-addressed store, hash-verified

2971}
2972
2973func createAggrChunk(t *testing.T, step time.Duration, from model.Time, points int, enc encoding.Encoding) storepb.AggrChunk {
2974 c := util.GenerateChunk(t, step, from, points, enc)
2975 chunkType := storepb.Chunk_XOR
2976 switch enc {
2977 case encoding.PrometheusHistogramChunk:
2978 chunkType = storepb.Chunk_HISTOGRAM
2979 case encoding.PrometheusFloatHistogramChunk:
2980 chunkType = storepb.Chunk_FLOAT_HISTOGRAM
2981 default:
2982 }
2983 return storepb.AggrChunk{
2984 MinTime: int64(c.From),
2985 MaxTime: int64(c.Through),
2986 Raw: &storepb.Chunk{
2987 Type: chunkType,
2988 Data: c.Data.Bytes(),
2989 },
2990 }
2991}

Calls 2

GenerateChunkFunction · 0.92
BytesMethod · 0.65

Tested by

no test coverage detected