CLI tool to monitor CPU and GPU memory usage of Python processes
Project description
📊 PySysMetrics
PySysMetrics is a lightweight Python package and CLI tool that monitors memory usage (CPU & GPU) of active Python processes. Ideal for profiling and debugging resource consumption in machine learning or long-running data workflows.
📦 Installation
Install via pip:
pip install pysysmetrics
🚀 Features
- 📈 Monitor CPU memory usage for all Python processes.
- 🔥 Track GPU memory usage (via NVIDIA NVML).
- ⏱️ Configurable interval for periodic monitoring.
- 🧪 Minimal dependencies, easy to integrate in workflows.
- ✅ Works on Linux, macOS, and Windows (CPU only).
🛠️ Usage
Run the CLI directly after installing:
pysysmetrics --cpu 2
Available Options
| Flag | Description | Example |
|---|---|---|
--cpu N |
Monitor CPU memory every N seconds |
--cpu 5 |
--gpu N |
Monitor GPU memory every N seconds |
--gpu 3 |
Examples
# Monitor CPU memory every 2 seconds
pysysmetrics --cpu 2
# Monitor GPU memory every 5 seconds
pysysmetrics --gpu 5
If no arguments are passed, a help message is displayed:
pysysmetrics
📚 Python API
You can also use pysysmetrics programmatically in your own Python scripts:
from pysysmetrics.core import cpu, gpu
# Monitor CPU usage every 3 seconds
cpu.monitor_cpu_memory(interval=3)
# Monitor GPU usage every 2 seconds
gpu.monitor_gpu_memory(interval=2)
🔧 Requirements
- Python 3.7 or later
📌 Notes
-
GPU monitoring requires:
- NVIDIA GPU with drivers installed
- Working
nvidia-smi - Python bindings for NVML (
pynvml)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysysmetrics-0.1.3.tar.gz.
File metadata
- Download URL: pysysmetrics-0.1.3.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31a70d02d4945cb7dcb1332ab8687af789418a81a0831273820b528738b6a4aa
|
|
| MD5 |
d8580f2808db00c042e806b85568cb99
|
|
| BLAKE2b-256 |
ba72447bc636e26d17ccda67c5739baafa10b9a9c18bb78aa87d4df34ab8875a
|
File details
Details for the file pysysmetrics-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pysysmetrics-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18d9783a0eea1888f350fa4748958498972745daf22d32c397606a08a77f4184
|
|
| MD5 |
a683330bfc91671a26ff114e9ffaeb4c
|
|
| BLAKE2b-256 |
8c63945db1c41189f2e187be8b1d04d2f05f026cce8bac7526f577e15941f41d
|