Skip to main content

go 性能跟踪

· One min read

pprof

brew install gperftools
brew install graphviz

import _ "net/http/pprof"

http://localhost:1777/debug/pprof/
http://localhost:1777/debug/pprof/profile

go tool pprof http://localhost:1777/debug/pprof/profile

go-torch

go get github.com/uber/go-torch
cd $GOPATH/src/github.com/uber/go-torch
git clone https://github.com/brendangregg/FlameGraph.git

go-torch --file "profile" --url http://localhost:2345
go-torch -u http://localhost:1777/