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

Function BenchmarkCompactorDupes

tempodb/encoding/vparquet5/compactor_test.go:69–104  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

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