26 lines
883 B
Go
Raw Normal View History

2017-07-05 02:10:19 +00:00
package main
2018-04-15 08:36:51 +00:00
import (
"net/http"
"net/http/pprof"
2018-12-06 21:03:35 +00:00
"github.com/animenotifier/arn"
2018-04-15 08:36:51 +00:00
)
2017-07-05 02:10:19 +00:00
func init() {
2018-12-06 21:03:35 +00:00
if !arn.IsDevelopment() {
return
}
2017-07-05 02:10:19 +00:00
2018-04-15 08:36:51 +00:00
app.Router.HandlerFunc("GET", "/debug/pprof/", http.HandlerFunc(pprof.Index))
app.Router.HandlerFunc("GET", "/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
app.Router.HandlerFunc("GET", "/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
app.Router.HandlerFunc("GET", "/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
app.Router.HandlerFunc("GET", "/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
2017-07-05 02:10:19 +00:00
2018-04-15 08:36:51 +00:00
app.Router.Handler("GET", "/debug/pprof/goroutine", pprof.Handler("goroutine"))
app.Router.Handler("GET", "/debug/pprof/heap", pprof.Handler("heap"))
app.Router.Handler("GET", "/debug/pprof/threadcreate", pprof.Handler("threadcreate"))
app.Router.Handler("GET", "/debug/pprof/block", pprof.Handler("block"))
2017-07-05 02:10:19 +00:00
}