Last active
January 22, 2022 08:37
-
-
Save Dreamacro/3a1b7b17e55d6917d05775091b1a8669 to your computer and use it in GitHub Desktop.
A simple docker image and shell function for pprof
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gopprof() { | |
echo $1 $2 $# | |
if [ "$1" = "ui" ]; then | |
docker run --rm -w `pwd` -v `pwd`:/where/your/ci/path -p 8081:8081 -it pprof go tool pprof -http="0.0.0.0:8081" "http://$2:6060/debug/pprof/heap" | |
else | |
docker run --rm -w `pwd` -v `pwd`:/where/your/ci/path -it pprof go tool pprof "http://$1:6060/debug/pprof/heap" | |
fi | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:alpine | |
# remove mirror repository if you don't need it | |
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \ | |
apk add --no-cache graphviz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment