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

Function BenchmarkDeconstruct

tempodb/encoding/vparquet3/schema_test.go:393–432  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

391}
392
393func BenchmarkDeconstruct(b *testing.B) {
394 meta := backend.BlockMeta{
395 DedicatedColumns: test.MakeDedicatedColumns(),
396 }
397
398 batchCount := 100
399 spanCounts := []int{
400 100, 1000,
401 10000,
402 }
403
404 poolSizes := []int{
405 100_000,
406 30_000_000,
407 }
408
409 for _, spanCount := range spanCounts {
410 for _, poolSize := range poolSizes {
411 ss := humanize.SI(float64(batchCount*spanCount), "")
412 ps := humanize.SI(float64(poolSize), "")
413 b.Run(fmt.Sprintf("SpanCount%v/Pool%v", ss, ps), func(b *testing.B) {
414 id := test.ValidTraceID(nil)
415 dbt := test.MakeTraceWithSpanCount(batchCount, spanCount, id)
416 test.AddDedicatedAttributes(dbt)
417
418 tr, _ := traceToParquet(&meta, id, dbt, nil)
419 sch := parquet.SchemaOf(tr)
420
421 b.ResetTimer()
422
423 pool := newRowPool(poolSize)
424
425 for i := 0; i < b.N; i++ {
426 r2 := sch.Deconstruct(pool.Get(), tr)
427 pool.Put(r2)
428 }
429 })
430 }
431 }
432}
433
434func TestParquetRowSizeEstimate(t *testing.T) {
435 // use this test to parse actual Parquet files and compare the two methods of estimating row size

Callers

nothing calls this directly

Calls 9

MakeDedicatedColumnsFunction · 0.92
ValidTraceIDFunction · 0.92
MakeTraceWithSpanCountFunction · 0.92
AddDedicatedAttributesFunction · 0.92
traceToParquetFunction · 0.70
newRowPoolFunction · 0.70
GetMethod · 0.65
RunMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected