pprof
pprof是GoLang程序性能分析工具,prof是profile(画像)的缩写 .通过pprof,我们可以得到程序执行的以下数据:
Profile Descriptions:
allocs...获取配置文件后,使用go工具pprof命令调查配置文件。...数据获取方式
go的运行有2种情况,一种是常驻内存 服务式运行,例如http,tcp服务,一直运行接收请求,一种是工具脚本形式,运行完则退出
工具型应用
工具型应用调用比较简单,主要是用 runtime...tool pprof 工具读取显示,在下面会讲到
服务型应用
服务型应用通过 "net/http/pprof"库进行获取,在http库中,默认使用了defaultServerMux,可以直接使用即可获取... get -u github.com/ofabry/go-callvis
内存画像
执行go tool pprof http://localhost:8080/debug/pprof/heap 即可