astrofrog / psrecord

Record the CPU and memory activity of a process :chart_with_upwards_trend:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Empty results when psrecord starts a command

saaj opened this issue · comments

commented

psrecord --plot 0.png --interval 0.1 "python -m timeit '2 * 2'"

does not work

There's workaround with bash which works:
python -m timeit '2 * 2' & psrecord --plot 1.png --interval 0.1 $!

works

Testing a program with several calls to subprocess.Popen. The graphs were quite different, and this little trick helped me to better visualize what was going on. +1 and thanks!!

I suppose this cute library isn't very maintained... I'll try to get around to it.
In the meantime, another workaround is using --include-children flag. It's not idea, because if your process creates sub processes you might not want to count them too...