This is a simple monitoring class built around psutil. The idea is that this will monitor cpu and ram usage between starting and stopping the monitoring.
-
To use simply import the package:
from emerald_monitor import ResourceMonitor
-
Then you can initialize the monitor:
monitor = ResourceMonitor()
-
Start the logger:
monitor.start_logging()
-
Run any function or process
-
Stop the logger:
monitor.stop_logging()
You can view a plot of the logs using:
and, you can view the logs as a pandas dataframe:
And, of course you can export the logs using pandas export options. For example:
monitor_info.to_csv(<output file path>, index=False)
See the example usage notebook for a more detailed out line of the usage