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

Function generateRequest

pkg/ingest/encoding_test.go:156–168  ·  view source on GitHub ↗

Helper function to generate a test trace

(entries, lineLength int)

Source from the content-addressed store, hash-verified

154
155// Helper function to generate a test trace
156func generateRequest(entries, lineLength int) *tempopb.PushBytesRequest {
157 stream := &tempopb.PushBytesRequest{
158 Traces: make([]tempopb.PreallocBytes, entries),
159 Ids: make([][]byte, entries),
160 }
161
162 for i := 0; i < entries; i++ {
163 stream.Traces[i].Slice = generateRandomString(lineLength)
164 stream.Ids[i] = generateRandomString(lineLength)
165 }
166
167 return stream
168}
169
170// Helper function to generate a random string
171func generateRandomString(length int) []byte {

Calls 1

generateRandomStringFunction · 0.85

Tested by

no test coverage detected