MCPcopy
hub / github.com/grafana/tempo / cutTestBlockWithTraces

Function cutTestBlockWithTraces

tempodb/compactor_test.go:838–855  ·  view source on GitHub ↗
(t testing.TB, w Writer, data []testData)

Source from the content-addressed store, hash-verified

836}
837
838func cutTestBlockWithTraces(t testing.TB, w Writer, data []testData) common.BackendBlock {
839 dec := model.MustNewSegmentDecoder(model.CurrentEncoding)
840
841 wal := w.WAL()
842
843 meta := &backend.BlockMeta{BlockID: backend.NewUUID(), TenantID: testTenantID}
844 head, err := wal.NewBlock(meta, model.CurrentEncoding)
845 require.NoError(t, err)
846
847 for _, d := range data {
848 writeTraceToWal(t, head, dec, d.id, d.t, d.start, d.end)
849 }
850
851 b, err := w.CompleteBlock(context.Background(), head)
852 require.NoError(t, err)
853
854 return b
855}
856
857func cutTestBlocks(t testing.TB, w Writer, tenantID string, blockCount int, recordCount int) []common.BackendBlock {
858 blocks := make([]common.BackendBlock, 0)

Calls 6

MustNewSegmentDecoderFunction · 0.92
NewUUIDFunction · 0.92
NewBlockMethod · 0.80
writeTraceToWalFunction · 0.70
WALMethod · 0.65
CompleteBlockMethod · 0.65

Tested by

no test coverage detected