Pyroscope是一个纯GO措辞编写的程序性能剖析平台,支持查见地式间的调用关系和CPU利用情形,并且利用了图表和调用树展示,方便查找代码中的性能问题。
特点:
快速利用(以Ubuntu环境为例):

1、下载包
wget https://dl.pyroscope.io/release/pyroscope_0.0.37_amd64.deb
2、安装
sudo apt-get install ./pyroscope_0.0.37_amd64.deb
3、启动做事
sudo systemctl start pyroscope-serversudo systemctl enable pyroscope-server
4、剖析程序(以GO程序为例)
package mainimport "github.com/pyroscope-io/pyroscope/pkg/agent/profiler"func main() {profiler.Start(profiler.Config{ApplicationName: "simple.golang.app",// pyroscope做事器地址ServerAddress: "http://pyroscope-server:4040",// 选择须要利用的剖析器,默认全部开启ProfileTypes: []profiler.ProfileType{profiler.ProfileCPU,profiler.ProfileAllocObjects,profiler.ProfileAllocSpace,profiler.ProfileInuseObjects,profiler.ProfileInuseSpace,},})//你的代码放在这里}
5、在http://localhost:4040/查看剖析情形
Pyroscope目前支持Ruby、Python、Go、Linux eBPF、PHP和.NET剖析,JAVA版本正在开拓中,并且该项目一贯在掩护,未来还会加入更多功能,感兴趣的同学可以理解一下。
GitHub:https://github.com/pyroscope-io/pyroscope
往期推举:
一个基于Python的3D图表库
GO措辞高效爬虫软件Pholcus
机器学习入门教程tutorials