Skip to content

Commit 737062c

Browse files
committed
feat: add block profiling to collect-profiles.sh
1 parent 6c6a550 commit 737062c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

bin/collect-profiles.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ go tool pprof -symbolize=remote -svg -output mutex.svg "$SOURCE_URL/debug/pprof/
4646
echo "Disabling mutex profiling"
4747
curl -X POST "$SOURCE_URL"'/debug/pprof-mutex/?fraction=0'
4848

49+
echo "Enabling block profiling"
50+
curl -X POST "$SOURCE_URL"'/debug/pprof-block/?rate=1000000' # profile every 1 ms
51+
52+
echo "Waiting for block data to be updated (30s)"
53+
sleep 30
54+
curl -s -o block.txt "$SOURCE_URL"'/debug/pprof/block?debug=2'
55+
go tool pprof -symbolize=remote -svg -output block.svg "$SOURCE_URL/debug/pprof/block"
56+
57+
echo "Disabling block profiling"
58+
curl -X POST "$SOURCE_URL"'/debug/pprof-block/?rate=0'
59+
4960
OUTPUT_NAME=ipfs-profile-$(uname -n)-$(date +'%Y-%m-%dT%H:%M:%S%z').tar.gz
5061
echo "Creating $OUTPUT_NAME"
5162
popd > /dev/null

0 commit comments

Comments
 (0)