github.com/yaling888/clash@v1.53.0/hub/route/pprof.go (about)

     1  package route
     2  
     3  import (
     4  	"net/http"
     5  	"net/http/pprof"
     6  
     7  	"github.com/go-chi/chi/v5"
     8  )
     9  
    10  func pprofRouter() http.Handler {
    11  	r := chi.NewRouter()
    12  	r.Get("/", pprof.Index)
    13  	r.Get("/cmdline", pprof.Cmdline)
    14  	r.Get("/profile", pprof.Profile)
    15  	r.Get("/symbol", pprof.Symbol)
    16  	r.Get("/trace", pprof.Trace)
    17  	r.Get("/allocs", pprof.Handler("allocs").ServeHTTP)
    18  	r.Get("/block", pprof.Handler("block").ServeHTTP)
    19  	r.Get("/goroutine", pprof.Handler("goroutine").ServeHTTP)
    20  	r.Get("/heap", pprof.Handler("heap").ServeHTTP)
    21  	r.Get("/mutex", pprof.Handler("mutex").ServeHTTP)
    22  	r.Get("/threadcreate", pprof.Handler("threadcreate").ServeHTTP)
    23  	return r
    24  }