-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Add debug heap/goroutine collection script
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
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
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 | ||
|