(b *testing.B)
| 493 | } |
| 494 | |
| 495 | func 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 | |
| 530 | func BenchmarkWalSearchTagValues(b *testing.B) { |
| 531 | tags := []string{ |
nothing calls this directly
no test coverage detected