Register pprof handlers.

This commit is contained in:
Timo Reimann 2017-11-20 11:04:03 +01:00 committed by Traefiker
parent 05a9350e57
commit be306d651e
3 changed files with 14 additions and 1 deletions

View file

@ -4,6 +4,7 @@ import (
"expvar"
"fmt"
"net/http"
"net/http/pprof"
"runtime"
"github.com/containous/mux"
@ -36,4 +37,10 @@ func (g DebugHandler) AddRoutes(router *mux.Router) {
})
fmt.Fprint(w, "\n}\n")
})
router.Methods(http.MethodGet).PathPrefix("/debug/pprof/").HandlerFunc(pprof.Index)
router.Methods(http.MethodGet).PathPrefix("/debug/pprof/cmdline").HandlerFunc(pprof.Cmdline)
router.Methods(http.MethodGet).PathPrefix("/debug/pprof/profile").HandlerFunc(pprof.Profile)
router.Methods(http.MethodGet).PathPrefix("/debug/pprof/symbol").HandlerFunc(pprof.Symbol)
router.Methods(http.MethodGet).PathPrefix("/debug/pprof/trace").HandlerFunc(pprof.Trace)
}