The Performance Monitor is a Python script designed to monitor and log the performance metrics of a specific process on your system. It tracks CPU, RAM, GPU usage, and VRAM utilization over time. This tool is particularly useful for analyzing the resource consumption of applications, especially in development and testing environments.
- Monitors CPU and RAM usage.
- Monitors GPU and VRAM usage (requires NVIDIA GPU).
- Logs performance data to an Excel file for easy visualization and analysis.
- Adjustable data recording intervals based on the monitoring duration.
- Calculates and displays average resource usage statistics.
To run the Performance Monitor, you need to have the following Python libraries installed:
timepsutilfor CPU and RAM monitoring.openpyxlfor logging data to an Excel file.pynvmlfor NVIDIA GPU monitoring.
Install these dependencies using pip:
pip3 install -r requirements.txt
Clone the repository or download the PerformanceMonitor.py script to your local machine.
- Open a terminal or command prompt.
- Navigate to the directory containing
PerformanceMonitor.py. - Run the script with the command you want to monitor as an argument:
python3 PerformanceMonitor.py <command or PID number>
Replace <command or PID number> with the command you wish to monitor (e.g., python your_script.py or 55899).
The script will create an Excel file named Performance.xlsx in the same directory, containing the performance metrics logged during the monitoring period.