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

Function TestPerformanceTestingHints_Search

pkg/traceql/fake_data_test.go:16–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14const testAccuracy = 100 * time.Millisecond
15
16func TestPerformanceTestingHints_Search(t *testing.T) {
17 synctest.Test(t, func(t *testing.T) {
18 engine := NewEngine()
19
20 req := &tempopb.SearchRequest{
21 Query: `{} with (debug_return_in=100s, debug_data_factor=1)`,
22 Start: uint32(time.Now().Add(-1 * time.Hour).Unix()),
23 End: uint32(time.Now().Unix()),
24 }
25
26 start := time.Now()
27 resp, err := engine.ExecuteSearch(context.Background(), req, nil, WithUnsafeHints(true))
28 elapsed := time.Since(start)
29
30 require.NoError(t, err)
31 require.NotNil(t, resp)
32 require.NotEmpty(t, resp.Traces)
33 assert.InDelta(t, elapsed, 100*time.Second, float64(testAccuracy))
34 })
35}
36
37func TestPerformanceTestingHints_SearchWithStdDev(t *testing.T) {
38 synctest.Test(t, func(t *testing.T) {

Callers

nothing calls this directly

Calls 6

ExecuteSearchMethod · 0.95
NewEngineFunction · 0.85
WithUnsafeHintsFunction · 0.85
TestMethod · 0.80
AddMethod · 0.65
NowMethod · 0.65

Tested by

no test coverage detected