add pprof handler (#1587)

pull/1590/head
Tony Chen 3 years ago committed by GitHub
parent ef686a1cc7
commit b353ab91f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      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
}
Loading…
Cancel
Save