Refactor api/http to just pprof
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
058eea362a
commit
435a1c825d
3 changed files with 23 additions and 27 deletions
18
api/pprof/pprof.go
Normal file
18
api/pprof/pprof.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue