CPU Tracker is a simple tool to monitor and track CPU usage of specific processes.
- Go (if building from source)
- wget (for downloading prebuilt binaries)
- jq (for processing JSON output)
If you don't have Go installed and just want to use the prebuilt binaries, you can download them from the latest release:
| OS | Arch | Link |
|---|---|---|
| Linux | amd64 (x86_64) | cpu-tracker-linux-amd64 |
| Linux | arm64 (ARM 64) | cpu-tracker-linux-arm64 |
| macOS | amd64 (x86_64) | cpu-tracker-darwin-amd64 |
| macOS | arm64 (M1/M2) | cpu-tracker-darwin-arm64 |
wget -c https://github.com/fcostaoliveira/cpu-tracker/releases/latest/download/cpu-tracker-$(uname -mrs | awk '{ print tolower($1) }')-$(dpkg --print-architecture).tar.gz -O - | tar -xz
# Run the tool
./cpu-tracker --helpIf you prefer to build from source, run:
go install github.com/fcostaoliveira/cpu-tracker@latestcurl -X POST http://localhost:5000/start/pgrep/redis-servercurl -s -X POST http://localhost:5000/stop/redis-server | jqExample output:
{
"message": "Stopped process redis-server",
"median_cpu": 10.5,
"p95_cpu": 15.2,
"p99_cpu": 18.7,
"cpu_details": [
{ "timestamp": "2025-03-04T12:00:00Z", "user_cpu": 5.2, "system_cpu": 3.1, "total_cpu": 8.3 }
]
}curl -s -X POST http://localhost:5000/stop/ | jqMIT License. See LICENSE for details.
This project is maintained by fcostaoliveira.