diff --git a/transport/http/pprof/pprof.go b/transport/http/pprof/pprof.go new file mode 100644 index 000000000..eab56bf61 --- /dev/null +++ b/transport/http/pprof/pprof.go @@ -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 +}