go tool pprof

package main
import   _ "net/http/pprof"


func main() {
   go func() {
            http.ListenAndServe("0.0.0.0:6060", nil)
         }()
select {}

}
 

[root@localhost dim-server]# go tool pprof ./dim-test  http://127.0.0.1:6060/debug/pprof/profile?second=2s
Fetching profile over HTTP from http://127.0.0.1:6060/debug/pprof/profile?second=2s
Saved profile in /root/pprof/pprof.dim-test.samples.cpu.002.pb.gz
File: dim-test
Type: cpu
Time: Mar 25, 2020 at 2:53pm (CST)
Duration: 30.01s, Total samples = 50ms ( 0.17%)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top
Showing nodes accounting for 50ms, 100% of 50ms total
Showing top 10 nodes out of 42
      flat  flat%   sum%        cum   cum%
      20ms 40.00% 40.00%       20ms 40.00%  runtime.futex
      10ms 20.00% 60.00%       10ms 20.00%  net.(*conn).Write
      10ms 20.00% 80.00%       10ms 20.00%  runtime.usleep
      10ms 20.00%   100%       10ms 20.00%  syscall.Syscall
         0     0%   100%       10ms 20.00%  bufio.(*Reader).Read
         0     0%   100%       10ms 20.00%  github.com/Shopify/sarama.(*Broker).Fetch
         0     0%   100%       10ms 20.00%  github.com/Shopify/sarama.(*Broker).readFull
         0     0%   100%       20ms 40.00%  github.com/Shopify/sarama.(*Broker).responseReceiver
         0     0%   100%       10ms 20.00%  github.com/Shopify/sarama.(*Broker).send
         0     0%   100%       10ms 20.00%  github.com/Shopify/sarama.(*Broker).sendAndReceive

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值