merge: testing → main (reconcile 2-week divergence)
This commit is contained in:
17
scripts/profile/cprofile-cli.sh
Executable file
17
scripts/profile/cprofile-cli.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run a `decnet` subcommand under cProfile and write a .prof file for snakeviz.
|
||||
# Usage: scripts/profile/cprofile-cli.sh services
|
||||
# scripts/profile/cprofile-cli.sh status
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "Usage: $0 <decnet-subcommand> [args...]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OUT="${OUT:-profiles/cprofile-$(date +%s).prof}"
|
||||
mkdir -p "$(dirname "$OUT")"
|
||||
|
||||
python -m cProfile -o "${OUT}" -m decnet.cli "$@"
|
||||
echo "Wrote ${OUT}"
|
||||
echo "View with: snakeviz ${OUT}"
|
||||
Reference in New Issue
Block a user