gin 框架下单纯的使用, "net/http/pprof", 发现 404 page not found, 那是因为在gin框架下, 需要使用 "github.com/gin-contrib/pprof",
具体如下:
engine := gin.Default()
//性能监控
pprof.Register(engine, "dev/pprof")
这样就能使用了
![](https://img.haomeiwen.com/i16074375/95c6c12467c61ed1.png)
gin 框架下单纯的使用, "net/http/pprof", 发现 404 page not found, 那是因为在gin框架下, 需要使用 "github.com/gin-contrib/pprof",
具体如下:
engine := gin.Default()
//性能监控
pprof.Register(engine, "dev/pprof")
这样就能使用了
本文标题:go gin 框架下的性能分析
本文链接:https://www.haomeiwen.com/subject/rlojgltx.html
网友评论