(pprof support.Pprof, dest *zip.Writer)
| 561 | } |
| 562 | |
| 563 | func writePprofData(pprof support.Pprof, dest *zip.Writer) error { |
| 564 | // Write server pprof data directly to pprof directory |
| 565 | if pprof.Server != nil { |
| 566 | if err := writePprofCollection("pprof", pprof.Server, dest); err != nil { |
| 567 | return xerrors.Errorf("write server pprof data: %w", err) |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | // Write agent pprof data |
| 572 | if pprof.Agent != nil { |
| 573 | if err := writePprofCollection("pprof/agent", pprof.Agent, dest); err != nil { |
| 574 | return xerrors.Errorf("write agent pprof data: %w", err) |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | return nil |
| 579 | } |
| 580 | |
| 581 | func writePprofCollection(basePath string, collection *support.PprofCollection, dest *zip.Writer) error { |
| 582 | // Define the pprof files to write with their extensions |
no test coverage detected