pysys.process.monitorimpl

Contains implementations of the pysys.process.monitor.BaseProcessMonitor interface.

DEFAULT_PROCESS_MONITOR

pysys.process.monitorimpl.DEFAULT_PROCESS_MONITOR = <class 'pysys.process.monitorimpl.WindowsProcessMonitor'>

Specifies the default BaseProcessMonitor subclass to be used for monitoring OS-level process information on the current platform.

WindowsProcessMonitor

class pysys.process.monitorimpl.WindowsProcessMonitor(owner, process, interval, handlers, **pmargs)[source]

Bases: pysys.process.monitor.BaseProcessMonitor

Windows implementation of a process monitor.

Uses the GetProcessMemoryInfo, and GetProcessTimes APIs. The UserTime and KernelTime are summed together to calculate the CPU utilization for this process.

_timer_ns()[source]

Return a monotonically incrementing clock value in nanoseconds (1000**3) that can be used to calculate performance results.

start()[source]

Called on the main test thread to start monitoring in the background.

Performs any required initialization of data structures then starts the background thread.

Returns

This instance.

Return type

BaseProcessMonitor

UnixProcessMonitor

class pysys.process.monitorimpl.UnixProcessMonitor(owner, process, interval, handlers, **pmargs)[source]

Bases: pysys.process.monitor.BaseProcessMonitor

Unix implementation of a process monitor.

Uses the ps command line tool, reading columns pcpu, rss and vsz.