use profiler middleware

This commit is contained in:
Daniel Ponte 2024-11-10 10:17:02 -05:00
parent 6e1640e4b4
commit e97c9ced0e

View file

@ -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)
} }