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

Function TestLinkPoolRelease

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

Source from the content-addressed store, hash-verified

123}
124
125func TestLinkPoolRelease(t *testing.T) {
126 // Get a link from the pool and populate it
127 link1 := getLink()
128 link1.attrs = append(link1.attrs, attrVal{
129 a: traceql.NewAttribute("key1"),
130 s: traceql.NewStaticString("value1"),
131 })
132 link1.attrs = append(link1.attrs, attrVal{
133 a: traceql.NewAttribute("key2"),
134 s: traceql.NewStaticString("value2"),
135 })
136
137 putLink(link1)
138
139 link2 := getLink()
140
141 // Verify the reused link is properly cleared
142 assert.Len(t, link2.attrs, 0, "attrs should be cleared")
143}
144
145func TestRowPoolRelease(t *testing.T) {
146 pool := newRowPool(5)

Callers

nothing calls this directly

Calls 5

NewAttributeFunction · 0.92
NewStaticStringFunction · 0.92
getLinkFunction · 0.70
putLinkFunction · 0.70
LenMethod · 0.65

Tested by

no test coverage detected