[#1462] node: Add off-cpu profiler

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-10-30 16:42:09 +03:00
parent 5bcf81d1cc
commit d19ab43500
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0
3 changed files with 22 additions and 0 deletions

View file

@ -3,8 +3,14 @@ package httputil
import (
"net/http"
"net/http/pprof"
"github.com/felixge/fgprof"
)
func init() {
http.DefaultServeMux.Handle("/debug/fgprof", fgprof.Handler())
}
// initializes pprof package in order to
// register Prometheus handlers on http.DefaultServeMux.
var _ = pprof.Handler("")