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

Function BenchmarkCompactorDupes

tempodb/encoding/vparquet4/compactor_test.go:72–107  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

70}
71
72func BenchmarkCompactorDupes(b *testing.B) {
73 rawR, rawW, _, err := local.New(&local.Config{
74 Path: b.TempDir(),
75 })
76 require.NoError(b, err)
77
78 r := backend.NewReader(rawR)
79 w := backend.NewWriter(rawW)
80 ctx := context.Background()
81 l := log.NewNopLogger()
82
83 cfg := &common.BlockConfig{
84 BloomFP: 0.01,
85 BloomShardSizeBytes: 100 * 1024,
86 RowGroupSizeBytes: 20_000_000,
87 }
88
89 // 1M span traces
90 meta := createTestBlock(b, ctx, cfg, r, w, 10, 1000, 1000, 1, nil)
91 inputs := []*backend.BlockMeta{meta, meta}
92
93 b.ResetTimer()
94
95 for i := 0; i < b.N; i++ {
96 c := NewCompactor(common.CompactionOptions{
97 BlockConfig: *cfg,
98 OutputBlocks: 1,
99 MaxBytesPerTrace: 50_000_000,
100 ObjectsCombined: func(_, _ int) {},
101 SpansDiscarded: func(_, _, _ string, _ int) {},
102 })
103
104 _, err = c.Compact(ctx, l, r, w, inputs)
105 require.NoError(b, err)
106 }
107}
108
109// createTestBlock with the number of given traces and the needed sizes.
110// Trace IDs are guaranteed to be monotonically increasing so that

Callers

nothing calls this directly

Calls 6

CompactMethod · 0.95
NewFunction · 0.92
NewReaderFunction · 0.92
NewWriterFunction · 0.92
createTestBlockFunction · 0.70
NewCompactorFunction · 0.70

Tested by

no test coverage detected