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

Function blockForBenchmarks

tempodb/encoding/vparquet5/block_traceql_test.go:2887–2915  ·  view source on GitHub ↗
(b testing.TB)

Source from the content-addressed store, hash-verified

2885}
2886
2887func blockForBenchmarks(b testing.TB) *backendBlock {
2888 id, ok := os.LookupEnv("VP5_BENCH_BLOCKID")
2889 if !ok {
2890 b.Fatal("VP5_BENCH_BLOCKID is not set. These benchmarks are designed to run against a block on local disk. Set VP5_BENCH_BLOCKID to the guid of the block to run benchmarks against. e.g. `export VP5_BENCH_BLOCKID=030c8c4f-9d47-4916-aadc-26b90b1d2bc4`")
2891 }
2892
2893 path, ok := os.LookupEnv("VP5_BENCH_PATH")
2894 if !ok {
2895 b.Fatal("VP5_BENCH_PATH is not set. These benchmarks are designed to run against a block on local disk. Set VP5_BENCH_PATH to the root of the backend such that the block to benchmark is at <VP5_BENCH_PATH>/<VP5_BENCH_TENANTID>/<VP5_BENCH_BLOCKID>.")
2896 }
2897
2898 tenantID, ok := os.LookupEnv("VP5_BENCH_TENANTID")
2899
2900 if !ok {
2901 tenantID = "1"
2902 }
2903
2904 blockID := uuid.MustParse(id)
2905 r, _, _, err := local.New(&local.Config{
2906 Path: path,
2907 })
2908 require.NoError(b, err)
2909
2910 rr := backend.NewReader(r)
2911 meta, err := rr.BlockMeta(context.Background(), blockID, tenantID)
2912 require.NoError(b, err)
2913
2914 return newBackendBlock(meta, rr)
2915}

Callers 12

BenchmarkFindTraceByIDFunction · 0.70
BenchmarkFetchTagValuesFunction · 0.70
BenchmarkFetchTagsFunction · 0.70
BenchmarkIteratorsFunction · 0.70
BenchmarkReadAllTracesFunction · 0.70
BenchmarkReadSingleTraceFunction · 0.70
TestSamplingErrorFunction · 0.70

Calls 4

BlockMetaMethod · 0.95
NewFunction · 0.92
NewReaderFunction · 0.92
newBackendBlockFunction · 0.70

Tested by

no test coverage detected