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

Function BenchmarkDeconstruct

tempodb/encoding/vparquet4/schema_test.go:803–842  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

801}
802
803func BenchmarkDeconstruct(b *testing.B) {
804 meta := backend.BlockMeta{
805 DedicatedColumns: test.MakeDedicatedColumns(),
806 }
807
808 batchCount := 100
809 spanCounts := []int{
810 100, 1000,
811 10000,
812 }
813
814 poolSizes := []int{
815 100_000,
816 30_000_000,
817 }
818
819 for _, spanCount := range spanCounts {
820 for _, poolSize := range poolSizes {
821 ss := humanize.SI(float64(batchCount*spanCount), "")
822 ps := humanize.SI(float64(poolSize), "")
823 b.Run(fmt.Sprintf("SpanCount%v/Pool%v", ss, ps), func(b *testing.B) {
824 id := test.ValidTraceID(nil)
825 dbt := test.MakeTraceWithSpanCount(batchCount, spanCount, id)
826 test.AddDedicatedAttributes(dbt)
827
828 tr, _ := traceToParquet(&meta, id, dbt, nil)
829 sch := parquet.SchemaOf(tr)
830
831 b.ResetTimer()
832
833 pool := newRowPool(poolSize)
834
835 for i := 0; i < b.N; i++ {
836 r2 := sch.Deconstruct(pool.Get(), tr)
837 pool.Put(r2)
838 }
839 })
840 }
841 }
842}
843
844func TestParquetRowSizeEstimate(t *testing.T) {
845 // 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