Skip to content

net/http/pprof: document all available default profiles #27737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nhooyr opened this issue Sep 18, 2018 · 4 comments
Closed

net/http/pprof: document all available default profiles #27737

nhooyr opened this issue Sep 18, 2018 · 4 comments
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Sep 18, 2018

The docs at the moment only mention a few of the available profiles.

See https://golang.org/pkg/net/http/pprof/

But there are plenty more:

var profileDescriptions = map[string]string{
  	"allocs":       "A sampling of all past memory allocations",
  	"block":        "Stack traces that led to blocking on synchronization primitives",
  	"cmdline":      "The command line invocation of the current program",
  	"goroutine":    "Stack traces of all current goroutines",
  	"heap":         "A sampling of memory allocations of live objects. You can specify the gc GET parameter to run GC before taking the heap sample.",
  	"mutex":        "Stack traces of holders of contended mutexes",
  	"profile":      "CPU profile. You can specify the duration in the seconds GET parameter. After you get the profile file, use the go tool pprof command to investigate the profile.",
  	"threadcreate": "Stack traces that led to the creation of new OS threads",
  	"trace":        "A trace of execution of the current program. You can specify the duration in the seconds GET parameter. After you get the trace file, use the go tool trace command to investigate the trace.",
  }

Should also document the behaviour of the "debug" query parameter controlling the response content type.

@gopherbot gopherbot added the Documentation Issues describing a change to documentation. label Sep 18, 2018
@agnivade
Copy link
Contributor

The profileDescriptions that you refer to is the output that is returned in /debug/pprof - which is a combined output of all profiles.

But net/http/pprof documentation should show only profiles from that package. The other profiles are from runtime/pprof. And it is documented there - https://golang.org/pkg/runtime/pprof/#Profile.

I don't think we should duplicate documentation across packages.

@nhooyr
Copy link
Contributor Author

nhooyr commented Sep 18, 2018

I don't think we should duplicate documentation across packages.

At the very least we should link to it.

@agnivade
Copy link
Contributor

/cc @ianlancetaylor @bradfitz

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/421635 mentions this issue: net/http/pprof: link docs to runtime/pprof

@dmitshur dmitshur added this to the Go1.20 milestone Aug 8, 2022
@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 8, 2022
@golang golang locked and limited conversation to collaborators Aug 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants