Skip to content

Commit

Permalink
🤖 Add debug heap/goroutine collection script
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler committed Feb 22, 2022
1 parent ab027c9 commit 12f293a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/collect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# Collect debug data.
# To run with edgevpn, run with --debug and --api flags on.
# Note: requires https://github.com/whyrusleeping/stackparse for parsing goroutine debug stacks

mkdir collect
((count=1))
while true; do
(( count = count + 1))
curl http://localhost:8080/debug/pprof/heap > collect/heap$count
curl 'http://localhost:8080/debug/pprof/goroutine' > collect/goroutine$count
curl 'http://localhost:8080/debug/pprof/goroutine?debug=2' > collect/goroutine_debug_$count
stackparse --summary collect/goroutine_debug_$count > collect/goroutine_debug_${count}_summary
sleep 60
done

0 comments on commit 12f293a

Please sign in to comment.