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

Function MakeTrace

pkg/util/test/req.go:237–249  ·  view source on GitHub ↗
(requests int, traceID []byte)

Source from the content-addressed store, hash-verified

235}
236
237func MakeTrace(requests int, traceID []byte) *tempopb.Trace {
238 traceID = ValidTraceID(traceID)
239
240 trace := &tempopb.Trace{
241 ResourceSpans: make([]*v1_trace.ResourceSpans, 0),
242 }
243
244 for range requests {
245 trace.ResourceSpans = append(trace.ResourceSpans, MakeBatch(rand.Int()%20+1, traceID)) // nolint:gosec // G404: Use of weak random number generator
246 }
247
248 return trace
249}
250
251func MakeTraceWithTimeRange(requests int, traceID []byte, startTime, endTime uint64) *tempopb.Trace {
252 traceID = ValidTraceID(traceID)

Callers 15

TestDBFunction · 0.92
TestBlockShardingFunction · 0.92
testCompleteBlockFunction · 0.92
benchmarkCompleteBlockFunction · 0.92
TestNoCompactFlagFunction · 0.92
TestPollNotificationFunction · 0.92
testCompactionRoundtripFunction · 0.92
testSameIDCompactionFunction · 0.92

Calls 3

MakeBatchFunction · 0.85
IntMethod · 0.80
ValidTraceIDFunction · 0.70

Tested by 15

TestDBFunction · 0.74
TestBlockShardingFunction · 0.74
testCompleteBlockFunction · 0.74
benchmarkCompleteBlockFunction · 0.74
TestNoCompactFlagFunction · 0.74
TestPollNotificationFunction · 0.74
testCompactionRoundtripFunction · 0.74
testSameIDCompactionFunction · 0.74