From a0d53199b710bf7cbb8516c2d4ca0e02e15658e0 Mon Sep 17 00:00:00 2001 From: Sean Liao Date: Fri, 19 May 2023 19:39:29 +0100 Subject: [PATCH] net/http/pprof: document query params Fixes #59452 Change-Id: Ia0b5a03565f663190c480ef9e26309fa85ff192c Reviewed-on: https://go-review.googlesource.com/c/go/+/496144 Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Dmitri Shuralyov Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor --- src/net/http/pprof/pprof.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/net/http/pprof/pprof.go b/src/net/http/pprof/pprof.go index db03af1c44..385eb423f7 100644 --- a/src/net/http/pprof/pprof.go +++ b/src/net/http/pprof/pprof.go @@ -27,6 +27,15 @@ // If you are not using DefaultServeMux, you will have to register handlers // with the mux you are using. // +// # Parameters +// +// Parameters can be passed via GET query params: +// +// - debug=N (all profiles): response format: N = 0: binary (default), N > 0: plaintext +// - gc=N (heap profile): N > 0: run a garbage collection cycle before profiling +// - seconds=N (allocs, block, goroutine, heap, mutex, threadcreate profiles): return a delta profile +// - seconds=N (cpu (profile), trace profiles): profile for the given duration +// // # Usage examples // // Use the pprof tool to look at the heap profile: -- 2.50.0