用于处理 Go 运行时分析数据的可视化接口
一个可视化界面,用于处理 Go 程序的运行时分析数据。
go get github.com/rakyll/gom/cmd/gom您愿意进行分析的程序应导入 GitHub.com/rakyll/gom/http 包。http 包将注册多个处理程序,以在运行时提供有关您的程序的信息。
import _ "github.com/rakyll/gom/http"
// If your application is not already running an http server,
// you need to start one.
log.Println(http.ListenAndServe("localhost:6060", nil))
如果您的 HTTP 服务器不处理 http.DefaultServeMux, 您需要手动注册 gom 处理器以响应"/debug/_gom"。 例如, gorilla/mux 用户可以使用以下代码片段:
import gomhttp "github.com/rakyll/gom/http"
mux := http.NewServeMux()
mux.HandleFunc("/debug/_gom", gomhttp.Handler())
log.Println(http.ListenAndServe("localhost:6060", nil))现在,您已经准备好启动 gom 了。
$ gomgo tool pprof。 * 允许用户按符号名进行过滤、隐藏和忽略。 * 提高用户对 Go 中的分析工具和包的认识。 * 在可能的情况下提供额外的轻量级统计信息。暂无开放 Issues,或尚未同步最近议题。