frostfs-node/pkg/util/http/pprof.go
Dmitrii Stepanov d19ab43500
[#1462] node: Add off-cpu profiler
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-10-31 11:32:13 +03:00

22 lines
430 B
Go

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("")
// Handler returns http.Handler for the
// Prometheus metrics collector.
func Handler() http.Handler {
return http.DefaultServeMux
}