MCPcopy
hub / github.com/prometheus/prometheus / buildTestChunks

Function buildTestChunks

storage/remote/codec_test.go:1181–1209  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1179)
1180
1181func buildTestChunks(t *testing.T) []prompb.Chunk {
1182 startTime := int64(0)
1183 chks := make([]prompb.Chunk, 0, numTestChunks)
1184
1185 time := startTime
1186
1187 for i := range numTestChunks {
1188 c := chunkenc.NewXORChunk()
1189
1190 a, err := c.Appender()
1191 require.NoError(t, err)
1192
1193 minTimeMs := time
1194
1195 for j := range numSamplesPerTestChunk {
1196 a.Append(0, time, float64(i+j))
1197 time += int64(1000)
1198 }
1199
1200 chks = append(chks, prompb.Chunk{
1201 MinTimeMs: minTimeMs,
1202 MaxTimeMs: time,
1203 Type: prompb.Chunk_XOR,
1204 Data: c.Bytes(),
1205 })
1206 }
1207
1208 return chks
1209}

Callers 6

TestReadClientFunction · 0.85
TestChunkedSeriesFunction · 0.85
TestChunkedSeriesSetFunction · 0.85

Calls 4

AppenderMethod · 0.95
BytesMethod · 0.95
NewXORChunkFunction · 0.92
AppendMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…