wait_and_monitor_usage(process,
timeout=300,
timeslice=0.1)
|
|
Wait until process is complete. Query maxrss and cpu time
used by the process and its children every so often (let the process to
run for timeslice seconds between observations).
If the process is still running after timeout , kill it
and all its children and raise an exception. If the exit code is not 0,
raise an exception.
Returns maxrss (in megabytes) and cpu time (in seconds).
- Parameters:
process - Process to watch, waiting for completion.
timeout - Duration (in seconds) to wait for the process.
timeslice - Interval (in seconds) between observations.
- Returns: (int, float)
- Max RSS (in megabytes) and CPU time (user, in seconds).
|