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

Function BenchmarkEncodeDecode

pkg/ingest/encoding_test.go:99–116  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

97}
98
99func BenchmarkEncodeDecode(b *testing.B) {
100 decoder := NewDecoder()
101 stream := generateRequest(1000, 200)
102
103 b.ResetTimer()
104 for i := 0; i < b.N; i++ {
105 records, err := Encode(0, "test-tenant", stream, 10<<20)
106 if err != nil {
107 b.Fatal(err)
108 }
109 for _, record := range records {
110 _, err := decoder.Decode(record.Value)
111 if err != nil {
112 b.Fatal(err)
113 }
114 }
115 }
116}
117
118func TestResetPushBytesRequest(t *testing.T) {
119 // Create a request with all fields set to non-zero values

Callers

nothing calls this directly

Calls 4

DecodeMethod · 0.95
NewDecoderFunction · 0.85
generateRequestFunction · 0.85
EncodeFunction · 0.85

Tested by

no test coverage detected