mirror of
https://github.com/mudler/edgevpn.git
synced 2025-09-26 21:01:44 +08:00
🤖 Add debug heap/goroutine collection script
This commit is contained in:
16
scripts/collect.sh
Normal file
16
scripts/collect.sh
Normal file
@@ -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
|
||||
|
Reference in New Issue
Block a user