Last active
March 4, 2022 11:15
-
-
Save ferranbt/e58c3f5032941a4b3550ff009afdb859 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) | |
URL=http://localhost:7071 | |
STATUS_CODE=$(wget --spider -S "$URL" 2>&1 | grep "HTTP/" | awk '{print $2}') | |
if [[ -z $STATUS_CODE ]]; then | |
echo "Pprof server not found at $URL. Are you running Bor with --pprof?" | |
exit 1 | |
fi | |
debug () { | |
wget --quiet -O $tmp_dir/$1 $URL/debug/pprof/$2 | |
} | |
echo "Generating profile traces..." | |
# trace calls | |
debug trace.out trace?seconds=30 | |
# cpu profile | |
debug profile.out profile?seconds=30 | |
# heap profile | |
debug heap.out heap | |
name=$(hostname)-$(date '+%Y-%m-%d-%s') | |
tar -zcf "$name.tar.gz" -C $tmp_dir . | |
echo "Please send us the file '$name'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added for automation at https://github.com/maticnetwork/aws-ssm/pull/18