-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
diagnostics: all pprofs #11891
diagnostics: all pprofs #11891
Conversation
diagnostics/profile.go
Outdated
|
||
//handle all pprof, supported: goroutine, threadcreate, heap, allocs, block, mutex | ||
metricsMux.HandleFunc("/pprof/", func(w http.ResponseWriter, r *http.Request) { | ||
profile := r.URL.Path[len("/pprof/"):] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use strings.TrimPrefix. Alternatively, you can also use HTTP params using r.URL.Query().Get("profile")
, but this changes your request format to /pprof?profile=<name>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
diagnostics/profile.go
Outdated
}) | ||
} | ||
|
||
func writePproProfile(w http.ResponseWriter, profile string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func writePproProfile(w http.ResponseWriter, profile string) { | |
func writeProfProfile(w http.ResponseWriter, profile string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed typo, I want it to have "Pprof" to point that I and getting data from this lib
Extended pprof read API to include: goroutine, threadcreate, heap, allocs, block, mutex
Extended pprof read API to include: goroutine, threadcreate, heap, allocs, block, mutex
Extended pprof read API to include: goroutine, threadcreate, heap, allocs, block, mutex