mirror of
https://github.com/go-kratos/kratos.git
synced 2024-12-30 21:19:57 +02:00
add pprof handler (#1587)
This commit is contained in:
parent
ef686a1cc7
commit
b353ab91f1
17
transport/http/pprof/pprof.go
Normal file
17
transport/http/pprof/pprof.go
Normal file
@ -0,0 +1,17 @@
|
||||
package pprof
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/pprof"
|
||||
)
|
||||
|
||||
// NewHandler new a pprof handler.
|
||||
func NewHandler() http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/debug/pprof/", pprof.Index)
|
||||
mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
|
||||
mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
|
||||
mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
|
||||
mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
|
||||
return mux
|
||||
}
|
Loading…
Reference in New Issue
Block a user