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

Function BenchmarkReadSingleTrace

tempodb/encoding/vparquet5/block_traceql_test.go:1884–1904  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1882}
1883
1884func BenchmarkReadSingleTrace(b *testing.B) {
1885 var (
1886 ctx = b.Context()
1887 opts = common.DefaultSearchOptions()
1888 block = blockForBenchmarks(b)
1889 )
1890
1891 // Get a trace ID from the first page.
1892 pf, _, err := block.openForSearch(ctx, opts)
1893 require.NoError(b, err)
1894 index, err := pf.RowGroups()[0].ColumnChunks()[0].ColumnIndex()
1895 require.NoError(b, err)
1896 id := index.MaxValue(0).ByteArray()
1897 require.NotNil(b, id)
1898
1899 for b.Loop() {
1900 tr, err := block.FindTraceByID(ctx, id, opts)
1901 require.NoError(b, err)
1902 require.NotNil(b, tr)
1903 }
1904}
1905
1906func TestSamplingError(t *testing.T) {
1907 // Comment this out to run tests when developing.

Callers

nothing calls this directly

Calls 6

DefaultSearchOptionsFunction · 0.92
LoopMethod · 0.80
blockForBenchmarksFunction · 0.70
ContextMethod · 0.65
FindTraceByIDMethod · 0.65
openForSearchMethod · 0.45

Tested by

no test coverage detected