Call functions to enable block/mutex pprof profiles.

This commit is contained in:
Timo Reimann 2018-07-06 10:58:04 +02:00 committed by Traefiker Bot
parent 689f120410
commit 0c0ecc1cdc

View file

@ -38,6 +38,8 @@ func (g DebugHandler) AddRoutes(router *mux.Router) {
fmt.Fprint(w, "\n}\n")
})
runtime.SetBlockProfileRate(1)
runtime.SetMutexProfileFraction(5)
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)