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

Function BenchmarkWalTraceQL

tempodb/encoding/vparquet4/wal_block_test.go:519–547  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

517}
518
519func BenchmarkWalTraceQL(b *testing.B) {
520 reqs := []string{
521 "{ .foo = `bar` }",
522 "{ span.foo = `bar` }",
523 "{ resource.foo = `bar` }",
524 }
525
526 w, warn, err := openWALBlock("15eec7d7-4b9f-4cf7-948d-fb9765ecd9a8+1+vParquet4", "/Users/marty/src/tmp/wal/", 0, 0)
527 require.NoError(b, err)
528 require.NoError(b, warn)
529
530 for _, q := range reqs {
531 req := traceql.MustExtractFetchSpansRequestWithMetadata(q)
532 b.Run(q, func(b *testing.B) {
533 for i := 0; i < b.N; i++ {
534 resp, err := w.Fetch(context.TODO(), req, common.DefaultSearchOptions())
535 require.NoError(b, err)
536
537 for {
538 ss, err := resp.Results.Next(context.TODO())
539 require.NoError(b, err)
540 if ss == nil {
541 break
542 }
543 }
544 }
545 })
546 }
547}
548
549func BenchmarkWalSearchTagValues(b *testing.B) {
550 tags := []string{

Callers

nothing calls this directly

Calls 6

DefaultSearchOptionsFunction · 0.92
openWALBlockFunction · 0.70
FetchMethod · 0.65
NextMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected