0
点赞
收藏
分享

微信扫一扫

fgprof golang profiler 支持on cpu 以及off cpu

fgprof 是相比golang 默认pprof 方便的工具,可以用来方便的分析on cpu 以及off cpu ,相比官方的提升不少

说明

没有银弹,fgprof 也有缺点的: 不支持c 函数,当前实现依赖go 的调度器,一些数据可能不准确,parca 也依赖了此包
具体是在parca server 中
参考处理

 

internalMux.HandleFunc("/debug/pprof/*", func(w http.ResponseWriter, r *http.Request) {

if r.URL.Path == "/debug/pprof/profile" {

pprof.Profile(w, r)

return

}

if r.URL.Path == "/debug/pprof/fgprof" {

fgprof.Handler().ServeHTTP(w, r)

return

}

pprof.Index(w, r)

})

参考资料

​​https://github.com/felixge/fgprof​​

举报

相关推荐

0 条评论