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

Function TestOne

tempodb/encoding/vparquet5/block_traceql_test.go:170–200  ·  tempodb/encoding/vparquet5/block_traceql_test.go::TestOne
(t *testing.T)

Source from the content-addressed store, hash-verified

168}
169
170func TestOne(t *testing.T) {
171 var (
172 ctx = t.Context()
173 wantTr = fullyPopulatedTestTrace(nil)
174 b = makeBackendBlockWithTraces(t, []*Trace{wantTr})
175 // q = `{ resource.service.name="foo" } | quantile_over_time(duration, 0.5) by (span.bar)`
176 q = `{} | rate()`
177 req = &tempopb.QueryRangeRequest{
178 Query: q,
179 Start: uint64(1000 * time.Second),
180 End: uint64(1001 * time.Second),
181 Step: uint64(1 * time.Second),
182 }
183 )
184 eval, err := traceql.NewEngine().CompileMetricsQueryRange(req, traceql.WithTimeOverlapCutoff(1))
185 require.NoError(t, err)
186 fetchSpansRequest := eval.FetchSpansRequest()
187
188 spanOnly, err := b.FetchSpans(ctx, fetchSpansRequest, common.DefaultSearchOptions())
189 require.NoError(t, err, "search request:", req)
190
191 spanset, err := b.Fetch(ctx, fetchSpansRequest, common.DefaultSearchOptions())
192 require.NoError(t, err, "search request:", req)
193
194 t.Log(q)
195 t.Log("-----------Fetch-----------")
196 t.Log(spanset.Results.(*spansetIterator).iter)
197 t.Log("-----------FetchSpans-----------")
198 t.Log(spanOnly.Results.(*spanOnlyIterator).iter)
199 t.Log("-----------")
200}
201
202func TestBackendNilKeyBlockSearchTraceQL(t *testing.T) {
203 numTraces := 100

Callers

nothing calls this directly

Calls 11

NewEngineFunction · 0.92
WithTimeOverlapCutoffFunction · 0.92
DefaultSearchOptionsFunction · 0.92
FetchSpansRequestMethod · 0.80
fullyPopulatedTestTraceFunction · 0.70
ContextMethod · 0.65
FetchSpansMethod · 0.65
FetchMethod · 0.65
LogMethod · 0.65

Tested by

no test coverage detected