(b *testing.B)
| 364 | } |
| 365 | |
| 366 | func 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 | |
| 387 | func compareBuckets(t *testing.T, want, got []*Bucket) { |
| 388 | if diff := cmp.Diff(want, got); diff != "" { |
nothing calls this directly
no test coverage detected
searching dependent graphs…