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

Function BenchmarkWalTraceQL

tempodb/encoding/vparquet5/wal_block_test.go:495–528  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

493}
494
495func BenchmarkWalTraceQL(b *testing.B) {
496 reqs := []string{
497 "{ .foo = `bar` }",
498 "{ span.foo = `bar` }",
499 "{ resource.foo = `bar` }",
500 }
501
502 w, warn, err := openWALBlock("15eec7d7-4b9f-4cf7-948d-fb9765ecd9a8+1+vparquet5", "/Users/marty/src/tmp/wal/", 0, 0)
503 require.NoError(b, err)
504 require.NoError(b, warn)
505
506 fetcher := traceql.NewSpansetFetcherWrapper(func(ctx context.Context, req traceql.FetchSpansRequest) (traceql.FetchSpansResponse, error) {
507 return w.Fetch(ctx, req, common.DefaultSearchOptions())
508 })
509 require.NoError(b, err)
510
511 for _, q := range reqs {
512 req := traceql.MustExtractFetchSpansRequestWithMetadata(q)
513 b.Run(q, func(b *testing.B) {
514 for i := 0; i < b.N; i++ {
515 resp, err := fetcher.Fetch(context.TODO(), req)
516 require.NoError(b, err)
517
518 for {
519 ss, err := resp.Results.Next(context.TODO())
520 require.NoError(b, err)
521 if ss == nil {
522 break
523 }
524 }
525 }
526 })
527 }
528}
529
530func BenchmarkWalSearchTagValues(b *testing.B) {
531 tags := []string{

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected