pyroscope

pyroscope 是 go+node开发的一款可视化性能分析工具,支持很多语言进行性能分析。

https://github.com/pyroscope-io/pyroscope

安装工具: https://pyroscope.io/downloads/

1docker run -it -p 4040:4040 pyroscope/pyroscope:0.29.0 server
2# or
3#  brew install pyroscope-io/brew/pyroscope    

go性能分析demo

 1import (
 2 "github.com/pyroscope-io/client/pyroscope"
 3  //	...
 4)
 5// 在main中加入这个即可
 6_, err := pyroscope.Start(pyroscope.Config{
 7		ApplicationName: "simple.golang.app",
 8		ServerAddress:   serverAddress,
 9		Logger:          pyroscope.StandardLogger,
10	})
11	if err != nil {
12		log.Fatalf("error starting pyroscope profiler: %v", err)
13	}