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

Function MakeTraceWithTimeRange

pkg/util/test/req.go:251–264  ·  view source on GitHub ↗
(requests int, traceID []byte, startTime, endTime uint64)

Source from the content-addressed store, hash-verified

249}
250
251func MakeTraceWithTimeRange(requests int, traceID []byte, startTime, endTime uint64) *tempopb.Trace {
252 traceID = ValidTraceID(traceID)
253
254 trace := &tempopb.Trace{
255 ResourceSpans: make([]*v1_trace.ResourceSpans, 0),
256 }
257
258 for range requests {
259 timeRange := &batchTimeRange{start: startTime, end: endTime}
260 trace.ResourceSpans = append(trace.ResourceSpans, makeBatchWithTimeRange(rand.Int()%20+1, traceID, timeRange, nil)) // nolint:gosec // G404: Use of weak random number generator
261 }
262
263 return trace
264}
265
266func MakeTraceWithSpanCount(requests int, spansEach int, traceID []byte) *tempopb.Trace {
267 trace := &tempopb.Trace{

Callers 1

MakePushBytesRequestFunction · 0.85

Calls 3

makeBatchWithTimeRangeFunction · 0.85
IntMethod · 0.80
ValidTraceIDFunction · 0.70

Tested by

no test coverage detected