按照教程运行go get github.com/uber/go-torch之后,运行go-torch -u http://localhost:8000 -t 100报错:
zsh: command not found: go-torch
解决方法:
没解决,换了另一个显示火焰图的方法。根据go-torch的GitHub的官方文档:
GitHub - uber-archive/go-torch: Stochastic flame graph profiler for Go programs
直接在终端运行:
go tool pprof -http=":8081" cpu.20220622144956.647.log //换成自己要读取的文件
就可自动弹出网页,在浏览器能看到火焰图: