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

Function generateRandomString

pkg/ingest/encoding_test.go:171–178  ·  view source on GitHub ↗

Helper function to generate a random string

(length int)

Source from the content-addressed store, hash-verified

169
170// Helper function to generate a random string
171func generateRandomString(length int) []byte {
172 const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
173 b := make([]byte, length)
174 for i := range b {
175 b[i] = charset[rand.Intn(len(charset))]
176 }
177 return b
178}
179
180func BenchmarkGeneratorDecoderOTLP(b *testing.B) {
181 traceBytes := marshalBatches(b, []*v1.ResourceSpans{

Callers 1

generateRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected