add pprof handler (#1587)
parent
ef686a1cc7
commit
b353ab91f1
@ -0,0 +1,17 @@ |
|||||||
|
package pprof |
||||||
|
|
||||||
|
import ( |
||||||
|
"net/http" |
||||||
|
"net/http/pprof" |
||||||
|
) |
||||||
|
|
||||||
|
// NewHandler new a pprof handler.
|
||||||
|
func NewHandler() http.Handler { |
||||||
|
mux := http.NewServeMux() |
||||||
|
mux.HandleFunc("/debug/pprof/", pprof.Index) |
||||||
|
mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) |
||||||
|
mux.HandleFunc("/debug/pprof/profile", pprof.Profile) |
||||||
|
mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) |
||||||
|
mux.HandleFunc("/debug/pprof/trace", pprof.Trace) |
||||||
|
return mux |
||||||
|
} |
Loading…
Reference in new issue