程序debug
· One min read
为服务添加监控 + trace 和 pprof
采集 trace
trace 采集,不建议的程序里采集,性能损耗比较大
curl http://192.168.0.99:31569/debug/pprof/trace?seconds=30 > trace.out
采集 goroutine
go tool pprof http://192.168.0.99:31569/debug/pprof/goroutine\?debug\=1
为服务添加监控 + trace 和 pprof
trace 采集,不建议的程序里采集,性能损耗比较大
curl http://192.168.0.99:31569/debug/pprof/trace?seconds=30 > trace.out
go tool pprof http://192.168.0.99:31569/debug/pprof/goroutine\?debug\=1