3e3abb7b by xiemengjun

add support goroutine pprof

1 parent c967f2d6
...@@ -156,7 +156,7 @@ func FilterPrefixPath(path string, filter http.HandlerFunc) *App { ...@@ -156,7 +156,7 @@ func FilterPrefixPath(path string, filter http.HandlerFunc) *App {
156 func Run() { 156 func Run() {
157 if PprofOn { 157 if PprofOn {
158 BeeApp.RegisterController(`/debug/pprof`, &ProfController{}) 158 BeeApp.RegisterController(`/debug/pprof`, &ProfController{})
159 BeeApp.RegisterController(`/debug/pprof/:pp([\w+])`, &ProfController{}) 159 BeeApp.RegisterController(`/debug/pprof/:pp([\w]+)`, &ProfController{})
160 } 160 }
161 BeeApp.Run() 161 BeeApp.Run()
162 } 162 }
......
...@@ -18,5 +18,8 @@ func (this *ProfController) Get() { ...@@ -18,5 +18,8 @@ func (this *ProfController) Get() {
18 pprof.Profile(this.Ctx.ResponseWriter, this.Ctx.Request) 18 pprof.Profile(this.Ctx.ResponseWriter, this.Ctx.Request)
19 } else if ptype == "symbol" { 19 } else if ptype == "symbol" {
20 pprof.Symbol(this.Ctx.ResponseWriter, this.Ctx.Request) 20 pprof.Symbol(this.Ctx.ResponseWriter, this.Ctx.Request)
21 } else {
22 pprof.Index(this.Ctx.ResponseWriter, this.Ctx.Request)
21 } 23 }
24 this.Ctx.ResponseWriter.WriteHeader(200)
22 } 25 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!