pumas
A nvtop-inspired command line tool for Apple Silicon Macs: aka M1, M2, ... This is basically a reimplemented version of asitop in Rust.
| Type | Metrics | Available | Comments |
|---|---|---|---|
| Utilization | CPU Clusters, GPU, ANE | ✓ | History & current values. ANE util. is measured via power |
| Power | CPU, GPU, ANE, total package | ✓ | History & current values |
| Frequency | CPU Clusters, GPU | ✓ | Current avg. values |
| Frequency | CPU Clusters, GPU | missing | Residency distrib. histograms |
| Memory | RAM & Swap: size and usage | ✓ | Activity Monitor compatible memory accounting via vm_stat |
To gather data, Pumas uses both the macOS built-in powermetrics utility, and the sysinfo
crate (same data as htop).
The built-in powermetrics allows access to a variety of hardware performance counters. Note
that Pumas requires sudo to run only due to powermetrics needing root access to run.
Pumas is lightweight and has minimal performance impact.
Quickstart
See installation methods below.
Sudo is required to run Pumas, as it uses Apple's powermetrics
to gather metrics.
Use the arrow keys to switch between tabs. Press Esc, q or x to quit.
Screenshots
Overview Tab: global metrics for utilization and power consumption.


CPU Tab: per-cluster CPU utilization (with short history) and frequency (with short history)


GPU Tab: GPU utilization (with short history) and frequency (with short history)


Memory Tab: detailed memory statistics compatible with Activity Monitor, showing VM statistics breakdown and sysinfo data


SoC Tab: misc info about the SoC

Installation Methods
Homebrew Tap
- Run:
Cargo Install
- Run:
Manual Build from Source
- Steps:
- Clone the repository:
- Change directory:
- Build the binary:
- Copy
target/release/pumasto a directory in yourPATH.
Prebuilt Binary Download
- Steps:
- Go to the GitHub Releases page.
- Download the latest macOS archive for your architecture.
- Extract the archive:
- Copy the binary to your
PATH(e.g.,/usr/local/bin):
- Verify installation:
x-cmd
This assumes you use x-cmd
- Run:
Usage
)
Pumas can run in two modes: UI mode (the default) and JSON mode.
)
)
JSON Mode
In JSON mode, Pumas will stream metrics to stdout as JSON instead of running the UI. You can
then pipe the metrics to jq, or create a node-exporter for Prometheus, etc.
For instance, the following command will stream the active ratio of the third CPU core of the first CPU cluster at each sample interval:
|
The JSON schema and an example are available in the schema directory.
Quick Launch
Some users reported they want a shorter way to launch Pumas. A quick way to do that is to
give your user the ability to sudo run without password the pumas command (and only that
command, for security reasons).
To achieve this, let's create a "drop-in" file /etc/sudoers.d/pumas
Add the following line to the file, replacing username with your username:
username ALL=(ALL) NOPASSWD: /opt/homebrew/bin/pumas
If you later remove pumas, you just have to delete this file. It's not a great practice to
modify /etc/sudoers directly.
Now you can run sudo pumas run without being asked your password. You're free to add an alias
to your shell, such as
Thanks to user @woshiniming007 for the suggestion!
Security considerations
- You should limit the commands you allow to run without password to the minimum necessary.
- You should use a drop-in file to avoid modifying
/etc/sudoersdirectly.
Source of metrics
sysinfo crate is used to measure the following:
- per-cluster CPU utilization
- per-core CPU utilization
- RAM & Swap usage & size (fallback)
powermetrics is used to measure the following:
CPU usage via(removed: incorrect on M2 chips)powermetrics- GPU utilization via active residency
- CPU & GPU frequency
- Package/CPU/GPU/ANE energy consumption
sysctl is used to measure the following:
- CPU name
- CPU core counts
system_profiler is used to measure the following:
- GPU core count
Some information is guesstimate and hardcoded as there doesn't seem to be a official source for it on the system:
- CPU, GPU & ANE max power draw
vm_stat is used to measure the following:
- Memory statistics compatible with Activity Monitor (anonymous, wired, compressed pages)
License
Licensed under the MIT License.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the MIT license, shall be licensed as MIT, without any additional terms or conditions.