我可以在以后运行pprof时下载一个堆转储文件吗?

huangapple go评论75阅读模式
英文:

Can I download a heap dump to run pprof on later?

问题

我正在尝试找到一种方法来存储pprof的堆数据,以便我可以共享它、稍后查看它、附加到问题等等。到目前为止,我的尝试都没有成功。

如果我运行

go tool pprof http://my-server/debug/pprof/heap 然后运行 web,我会得到一个完整的图形,就像我期望的那样。然而,如果我下载文件:

wget -O heapDump http://my-server/debug/pprof/heap

然后尝试 go tool pprof heapDump,它似乎无法完成所有需要的操作。我只得到一个非常有限的图形:

我可以在以后运行pprof时下载一个堆转储文件吗?

我尝试添加 ?debug=1 并尝试不同的值,但它们似乎都不能正常工作。

英文:

I'm trying to find a way to store the heap data from pprof so that I can share it, view it later, attach to issues and so on. My attempts so far have not worked.

If I run

go tool pprof http://my-server/debug/pprof/heap and then run web, I get a full graph like I expect. However, If I dowload the file:

wget -O heapDump http://my-server/debug/pprof/heap

and try go tool pprof heapDump, it seems it can't do everything it needs to. I only get a very limited graph:

我可以在以后运行pprof时下载一个堆转储文件吗?

I have tried adding ?debug=1 and playing with different values, but none of them seem to work properly.

答案1

得分: 1

go tool pprof -png http://my-server/debug/pprof/heap > out.png 命令会将一个合适的图形保存在 out.png 文件中。

英文:

go tool pprof -png http://my-server/debug/pprof/heap > out.png stores a proper graph for me in the out.png file.

huangapple
  • 本文由 发表于 2016年9月6日 23:56:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/39353219.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定