ska_sdp_batchlet.utils.monitor.resource module

class ska_sdp_batchlet.utils.monitor.resource.ResourceMonitor(generate_reports_on_failure=True, save_dir='./benchmon-work-dir', level=0)[source]

Bases: object

ResourceMonitor is responsible for monitoring the system resources (CPU, Memory) on single/multi-node system, while the subprocess command is running. It uses ska-sdp-benchmark-monitor for resource monitoring. This class should be instantiated and used within a "with" scope.

Parameters:
  • generate_reports_on_failure (bool, default: True) -- Whether to generate reports even if some exception occurs during exit

  • save_dir (str, default: './benchmon-work-dir') -- Directory to save the report.

  • level (int, default: 0) -- Level of the monitor.