add simple profiling script
This commit is contained in:
parent
7a7d619e64
commit
cb7c66a8d1
1 changed files with 13 additions and 0 deletions
13
scripts/profile
Executable file
13
scripts/profile
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh -eu
|
||||
|
||||
cd "$RUN_DIR"
|
||||
|
||||
outfile="profile-$(date '+%Y%m%d-%H%M%S').txt"
|
||||
|
||||
[ -z "${DEBUG:-}" ] || set -x
|
||||
|
||||
echo "# Writing profiler stats to: $outfile"
|
||||
python -m cProfile -o "$outfile" -m unwind "$@"
|
||||
|
||||
echo "# Loading stats file: $outfile"
|
||||
python -m pstats "$outfile"
|
||||
Loading…
Add table
Add a link
Reference in a new issue