Useful idea. I sometimes use time [1] to print stats at the end of the program's run, like so.<p><pre><code> /usr/bin/time -f 'user=%U system=%S maxrss=%M ins=%I outs=%O" PROGRAM
</code></pre>
Seeing stats while the program is running is nice though! Also, cumulative monitoring of an entire foreground process group would be super handy (a long build, for instance).<p>Drop the --target-output option, you don't need it. Same thing can be achieved with:<p><pre><code> monner.py sh -c 'exec 1>/dev/null 2>&1 $0 "$@"' PROGRAM
</code></pre>
I also agree with the other commenter that monner should be the parent process.<p>[1] Note, time(1) is not the same as the shell builtin of the same name.
what does "memory" mean here? it would be nice to have more details (eg virtual v physical). also disk io (with paging separate) would be good. and maybe files opened (like /prod/PID/fd/*)<p>it would be really nice to have something that shows all this for a single process (and perhaps also for other processes that are "top" in some category). at the moment, when i am trying to balance code to run as well as possible within given hardware constraints, i have to juggle various monitor programs - this is a good first step to using just one...