MCPcopy Index your code
hub / github.com/maruel/panicparse / BenchmarkAggregate

Function BenchmarkAggregate

stack/bucket_test.go:366–385  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

364}
365
366func BenchmarkAggregate(b *testing.B) {
367 b.ReportAllocs()
368 s, suffix, err := ScanSnapshot(bytes.NewReader(internaltest.StaticPanicwebOutput()), io.Discard, defaultOpts())
369 if err != io.EOF {
370 b.Fatal(err)
371 }
372 if s == nil {
373 b.Fatal("missing context")
374 }
375 if string(suffix) != "" {
376 b.Fatalf("unexpected suffix: %q", string(suffix))
377 }
378 b.ResetTimer()
379 for i := 0; i < b.N; i++ {
380 buckets := s.Aggregate(AnyPointer).Buckets
381 if len(buckets) < 5 {
382 b.Fatal("expected more buckets")
383 }
384 }
385}
386
387func compareBuckets(t *testing.T, want, got []*Bucket) {
388 if diff := cmp.Diff(want, got); diff != "" {

Callers

nothing calls this directly

Calls 4

StaticPanicwebOutputFunction · 0.92
ScanSnapshotFunction · 0.85
defaultOptsFunction · 0.85
AggregateMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…