use profiler middleware
This commit is contained in:
parent
6e1640e4b4
commit
e97c9ced0e
1 changed files with 2 additions and 7 deletions
|
@ -4,14 +4,9 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http/pprof"
|
"github.com/go-chi/chi/v5/middleware"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Server) installPprof() {
|
func (s *Server) installPprof() {
|
||||||
r := s.r
|
s.r.Mount("/debug", middleware.Profiler())
|
||||||
r.HandleFunc("/debug/pprof/", pprof.Index)
|
|
||||||
r.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
|
|
||||||
r.HandleFunc("/debug/pprof/profile", pprof.Profile)
|
|
||||||
r.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
|
|
||||||
r.HandleFunc("/debug/pprof/trace", pprof.Trace)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue