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

Function BenchmarkFindTraceByID

tempodb/wal/wal_test.go:438–454  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

436}
437
438func BenchmarkFindTraceByID(b *testing.B) {
439 for _, enc := range encoding.AllEncodingsForWrites() {
440 version := enc.Version()
441 b.Run(version, func(b *testing.B) {
442 runWALBenchmark(b, version, 1, func(ids [][]byte, objs []*tempopb.Trace, block common.WALBlock) {
443 ctx := context.Background()
444 for i := 0; i < b.N; i++ {
445 j := i % len(ids)
446
447 obj, err := block.FindTraceByID(ctx, ids[j], common.DefaultSearchOptions())
448 require.NoError(b, err)
449 require.Equal(b, objs[j], obj)
450 }
451 })
452 })
453 }
454}
455
456func BenchmarkFindUnknownTraceID(b *testing.B) {
457 for _, enc := range encoding.AllEncodingsForWrites() {

Callers

nothing calls this directly

Calls 7

AllEncodingsForWritesFunction · 0.92
DefaultSearchOptionsFunction · 0.92
runWALBenchmarkFunction · 0.85
VersionMethod · 0.65
FindTraceByIDMethod · 0.65
RunMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected