golang在window下查看火焰图

1. golang在window下查看火焰图

功能:查看生产golang程序执行过程中内存,cpu等状态的火焰图

1.1. 目录结构

|goprof
|–goprof.bat
|–graphviz-2.38 这是目录,可以从网上下载安装,拷贝对应目录过来
|–pprof.exe google/pprofpprof

1.2. 查看命令

新建.bat文件,拷贝下边内容进入,注意下边的 %PProf% 行只能放开一行哈

set Server=127.0.0.1:8999
set PWD=%~dp0

%~d0
cd %PWD%
call %PWD%\config.bat

echo %Server%

set Dot=%PWD%\graphviz-2.38\bin
set PATH=%Dot%;%PATH%
set PProf=%PWD%\pprof.exe
set PPROF_TMPDIR=%PWD%\data

::下边是关于CPU获取的方法
%PProf% -http : C:\work\20190603_190507.cpu.data
::%PProf% -http : -alloc_space http://%Server%/debug/pprof/heap
::%PProf% -http : -inuse_space http://%Server%/debug/pprof/heap
::%PProf% -http : http://%Server%/debug/pprof/profile?seconds=30

::下边是关于内存获取的方法
::%PProf% -http : .\data\pprof.samples.cpu.003.pb.gz
::%PProf% -http : http://%Server%/debug/pprof/heap
::%PProf% -http : -alloc_space http://%Server%/debug/pprof/heap
::%PProf% -http : -inuse_space http://%Server%/debug/pprof/heap

参考资料

  1. pprof
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值