aitune.utils.monitoring.setup_hardware_metrics
aitune.utils.monitoring.setup_hardware_metrics
Hardware metrics collector.
Module Contents
Classes
Functions
Data
API
Manages the lifecycle of hardware metrics collection.
Encapsulates the collector, receiver subprocess, runtime enable/disable state, and atexit registration.
Disable collection at runtime, gracefully stopping any active session.
Enable collection at runtime, overriding the env var.
Return the active collector, or a no-op when collection is disabled.
Return accumulated metrics, or None if collection was never started.
Dump currently collected metrics to a CSV file.
Parameters:
Path to write the CSV file.
If True, clears the accumulated metrics after writing.
Split a wide metrics table into narrower sub-tables for logging.
Each split contains the index columns (Module, Backend) plus up to 6 metric columns. Returns the original frame unchanged when there are at most 6 metric columns.
Disable hardware metrics collection at runtime.
Overrides the AITUNE_HARDWARE_METRICS environment variable. If collection was active, gracefully stops the receiver (dumping any accumulated metrics) and resets state so that a future enable_hardware_metrics() call starts a fresh collection session.
Logs metrics summary and dumps the metrics to a CSV file.
Parameters:
The metrics to dump.
Enable hardware metrics collection at runtime.
Overrides the AITUNE_HARDWARE_METRICS environment variable. The collector and receiver subprocess are started lazily on the first use.
Get the default hardware metrics collector.
Get metrics from the receiver.
Dump currently collected hardware metrics to a CSV file.
Parameters:
Path to write the CSV file.
If True, clears the accumulated metrics after writing.