golang性能调优工具pprof的使用


前言

pprof性能工具的使用


一、cpu

1.下载实例代码

实例代码地址https://github.com/wolfogre/go-pprof-practice

2.运行项目中的main.go文件

go run main.go

3.查看CPU性能数据

D:\program\goPath\src\bytedance\go-pprof-practice>go tool pprof "http://localhost:6060/debug/pprof/profile?seconds=10"
Fetching profile over HTTP from http://localhost:6060/debug/pprof/profile?seconds=10
Saved profile in C:\Users\helloworld\pprof\pprof.samples.cpu.001.pb.gz
Type: cpu
Time: May 12, 2022 at 8:51am (CST)
Duration: 10.12s, Total samples = 5.43s (53.68%)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top
Showing nodes accounting for 5.30s, 97.61% of 5.43s total
Dropped 27 nodes (cum <= 0.03s)
Showing top 10 nodes out of 18
      flat  flat%   sum%        cum   cum%
     4.62s 85.08% 85.08%      4.62s 85.08%  bytedance/go-pprof-practic
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值