hb-chen/echo-web

pprof 中间件路由使用

ukinhappy opened this issue · 0 comments

  e.Pre(pprof.Serve())

添加的这个中间件,是不能够使用一下命令行的吧,

 go tool pprof http://localhost:9293/debug/pprof/profile

pprof.Index(c.Response(), c.Request()) 函数只支持以下几个路径

profiles.m = map[string]*Profile{
			"goroutine":    goroutineProfile,
			"threadcreate": threadcreateProfile,
			"heap":         heapProfile,
			"block":        blockProfile,
			"mutex":        mutexProfile,
		}

对 go tool pprof http://localhost:9293/debug/pprof/profile 命令行

应该使用这个函数

pprof.Profile(c.Response(), c.Request())

这块是不是应该针对各种pprof单独设置路由。