diff --git a/xhttp/profiler.go b/xhttp/profiler.go new file mode 100644 index 0000000..5a36a51 --- /dev/null +++ b/xhttp/profiler.go @@ -0,0 +1,13 @@ +package xhttp + +import ( + "net/http" + "net/http/pprof" +) + +func AttachProfiler(mux *http.ServeMux) { + 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) +}