add support goroutine pprof
Showing
2 changed files
with
4 additions
and
1 deletions
| ... | @@ -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 | } | ... | ... |
-
Please register or sign in to post a comment