1、介绍
- net/http/pprof--->使用runtime/pprof包来进行封装并在http端口上暴露出来
- runtime/pprof
2、Demo
go func() {
http.ListenAndServe("0.0.0.0:8081", nil)
}()
3、查看
- 通过命令行查看
go tool pprof http://localhost:8081/debug/pprof/heap
- 亦可输入web通过UI方式查看
4、功能介绍
5、其他
- pb文件导出
go tool pprof profile D:\pprof.mesh-xds.samples.cpu.001.pb
未完待续......