aitune.utils.monitoring.hardware_metrics.parent_receiver
aitune.utils.monitoring.hardware_metrics.parent_receiver
Parent receiver for hardware metrics.
Module Contents
Classes
API
Receiver which gets metrics from queue and sends them to child process.
Communication uses pickle to serialize and deserialize data and sends/receives data via a stdin/stdout pipe.
If the main process dies, the child process will dump the collected metrics to a CSV file. If the main process is still alive and requests the metrics back, the child process will send them as pandas DataFrame so that it takes less memory to send them back.
Parameters:
The queue to send the metrics to.
Gets the metrics.
Returns: pd.DataFrame
The metrics as a pandas DataFrame.
Raises:
RuntimeError: If the receiver is not started.
Runs the receiver.
This method is run in a separate thread.
Dumps currently collected metrics to a file.
Parameters:
Path to write the CSV file.
If True, clears the accumulated metrics after writing.
Raises:
RuntimeError: If the receiver is not started.
Starts the receiver.
Stops the receiver.