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

Function TestEventPoolRelease

tempodb/encoding/vparquet5/block_traceql_pool_test.go:105–123  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func TestEventPoolRelease(t *testing.T) {
106 // Get an event from the pool and populate it
107 event1 := getEvent()
108 event1.attrs = append(event1.attrs, attrVal{
109 a: traceql.NewAttribute("key1"),
110 s: traceql.NewStaticString("value1"),
111 })
112 event1.attrs = append(event1.attrs, attrVal{
113 a: traceql.NewAttribute("key2"),
114 s: traceql.NewStaticString("value2"),
115 })
116
117 putEvent(event1)
118
119 event2 := getEvent()
120
121 // Verify the reused event is properly cleared
122 assert.Len(t, event2.attrs, 0, "attrs should be cleared")
123}
124
125func TestLinkPoolRelease(t *testing.T) {
126 // Get a link from the pool and populate it

Callers

nothing calls this directly

Calls 5

NewAttributeFunction · 0.92
NewStaticStringFunction · 0.92
getEventFunction · 0.70
putEventFunction · 0.70
LenMethod · 0.65

Tested by

no test coverage detected