collect.sh 606 B

12345678910111213141516
  1. #!/bin/bash
  2. # Collect debug data.
  3. # To run with edgevpn, run with --debug and --api flags on.
  4. # Note: requires https://github.com/whyrusleeping/stackparse for parsing goroutine debug stacks
  5. mkdir collect
  6. ((count=1))
  7. while true; do
  8. (( count = count + 1))
  9. curl http://localhost:8080/debug/pprof/heap > collect/heap$count
  10. curl 'http://localhost:8080/debug/pprof/goroutine' > collect/goroutine$count
  11. curl 'http://localhost:8080/debug/pprof/goroutine?debug=2' > collect/goroutine_debug_$count
  12. stackparse --summary collect/goroutine_debug_$count > collect/goroutine_debug_${count}_summary
  13. sleep 60
  14. done