From 0c0ecc1cdc28677786f628c65a12ab328470f243 Mon Sep 17 00:00:00 2001 From: Timo Reimann Date: Fri, 6 Jul 2018 10:58:04 +0200 Subject: [PATCH] Call functions to enable block/mutex pprof profiles. --- api/debug.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/debug.go b/api/debug.go index 4ddca7c28..785a61988 100644 --- a/api/debug.go +++ b/api/debug.go @@ -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)