Activate profiling on all versions

This commit is contained in:
Eduard Urbach 2019-03-26 19:31:34 +09:00
parent 722faa81ce
commit bdb69f7e63

View File

@ -3,14 +3,12 @@ package main
import ( import (
"net/http" "net/http"
"net/http/pprof" "net/http/pprof"
"github.com/animenotifier/arn"
) )
func init() { func init() {
if !arn.IsDevelopment() { // if !arn.IsDevelopment() {
return // return
} // }
app.Router.HandlerFunc("GET", "/debug/pprof/", http.HandlerFunc(pprof.Index)) 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/cmdline", http.HandlerFunc(pprof.Cmdline))
@ -22,4 +20,6 @@ func init() {
app.Router.Handler("GET", "/debug/pprof/heap", pprof.Handler("heap")) 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/threadcreate", pprof.Handler("threadcreate"))
app.Router.Handler("GET", "/debug/pprof/block", pprof.Handler("block")) app.Router.Handler("GET", "/debug/pprof/block", pprof.Handler("block"))
app.Router.Handler("GET", "/debug/pprof/allocs", pprof.Handler("allocs"))
app.Router.Handler("GET", "/debug/pprof/mutex", pprof.Handler("mutex"))
} }