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

Function BenchmarkCombine

tempodb/encoding/vparquet5/combiner_test.go:537–561  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

535}
536
537func BenchmarkCombine(b *testing.B) {
538 batchCount := 100
539 spanCounts := []int{
540 100, 1000, 10000,
541 }
542
543 for _, spanCount := range spanCounts {
544 b.Run("SpanCount:"+humanize.SI(float64(batchCount*spanCount), ""), func(b *testing.B) {
545 id1 := test.ValidTraceID(nil)
546 tr1, _ := traceToParquet(&backend.BlockMeta{}, id1, test.MakeTraceWithSpanCount(batchCount, spanCount, id1), nil)
547
548 id2 := test.ValidTraceID(nil)
549 tr2, _ := traceToParquet(&backend.BlockMeta{}, id2, test.MakeTraceWithSpanCount(batchCount, spanCount, id2), nil)
550
551 b.ResetTimer()
552
553 for i := 0; i < b.N; i++ {
554 c := NewCombiner()
555 c.ConsumeWithFinal(tr1, false)
556 c.ConsumeWithFinal(tr2, true)
557 c.Result()
558 }
559 })
560 }
561}
562
563func BenchmarkSortTrace(b *testing.B) {
564 batchCount := 100

Callers

nothing calls this directly

Calls 7

ConsumeWithFinalMethod · 0.95
ResultMethod · 0.95
ValidTraceIDFunction · 0.92
MakeTraceWithSpanCountFunction · 0.92
traceToParquetFunction · 0.70
NewCombinerFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected