MCPcopy Index your code
hub / github.com/coder/coder / writePprofData

Function writePprofData

cli/support.go:563–579  ·  view source on GitHub ↗
(pprof support.Pprof, dest *zip.Writer)

Source from the content-addressed store, hash-verified

561}
562
563func 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
581func writePprofCollection(basePath string, collection *support.PprofCollection, dest *zip.Writer) error {
582 // Define the pprof files to write with their extensions

Callers 1

writeBundleFunction · 0.85

Calls 2

writePprofCollectionFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected