containerd/api/pprof/pprof.go
Michael Crosby 435a1c825d Refactor api/http to just pprof
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-20 10:22:19 -07:00

18 lines
474 B
Go

package pprof
import (
// expvar init routine adds the "/debug/vars" handler
_ "expvar"
"net/http"
"net/http/pprof"
)
// New returns a new handler serving pprof information
func New() http.Handler {
mux := http.NewServeMux()
mux.Handle("/pprof/block", pprof.Handler("block"))
mux.Handle("/pprof/heap", pprof.Handler("heap"))
mux.Handle("/pprof/goroutine", pprof.Handler("goroutine"))
mux.Handle("/pprof/threadcreate", pprof.Handler("threadcreate"))
return mux
}