Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

macmon

> 云原生
Open source

️ Real-time system monitor for Apple Silicon Macs (M1–M5). No sudo. TUI, JSON/Prometheus metrics server, and Rust library.

1.8K stars0 likes1 views
WebsiteGitHub

About

️ Real-time system monitor for Apple Silicon Macs (M1–M5). No sudo. TUI, JSON/Prometheus metrics server, and Rust library.

macmon – Mac Monitor

macmon is a sudoless performance monitor for Apple Silicon Macs. It reads real-time CPU / GPU / ANE power usage, temperatures, and memory stats through a private macOS API — the same data powermetrics exposes — without requiring root access.

Features

  • Runs without sudo
  • ⚡ Real-time CPU / GPU / ANE power usage
  • CPU frequency-scaled and active ratios per cluster
  • RAM / Swap usage
  • Historical charts with average and max values
  • ️ Average CPU / GPU temperature
  • Switchable color themes (6 variants)
  • Can be displayed in a small window
  • Written in Rust

Installation

Install macmon using brew:

bash
brew install macmon
Other installation methods

Install using MacPorts:

bash
sudo port install macmon

Install using Cargo:

bash
cargo install macmon

Install using Nix:

bash
nix-env -i macmon

Usage

bash
Usage: macmon [OPTIONS] [COMMAND]

Commands:
  pipe    Output metrics in JSON format
  serve   Serve metrics over HTTP
  debug   Print debug information
  stress  Generate load for testing metrics
  help    Print this message or the help of the given subcommand(s)

Options:
  -i, --interval <INTERVAL>  Update interval in milliseconds [default: 1000]
  -h, --help                 Print help
  -V, --version              Print version

Interactive mode

Run macmon without a subcommand to open the terminal UI.

Controls:
  c - change color
  v - switch charts view: gauge / sparkline
  d - toggle detailed CPU/RAM view
  r - switch ratio mode: scaled / active
  q - quit

JSON output

You can use the pipe subcommand to output metrics in JSON format, which makes it suitable for piping into other tools or scripts. For example:

bash
macmon pipe | jq

This command runs macmon in "pipe" mode and sends the output to jq for pretty-printing.

You can also specify the number of samples to collect using the -s or --samples parameter (default: 0, which runs indefinitely), and set the update interval in milliseconds using the -i or --interval parameter (default: 1000 ms). For example:

bash
macmon pipe -s 10 -i 500 | jq

This will collect 10 samples with an update interval of 500 milliseconds.

HTTP server

You can use the serve subcommand to expose metrics over HTTP. This is useful for integrating with monitoring systems like Prometheus and Grafana.

bash
macmon serve                   # default port 9090, interval 1000ms
macmon serve --host 127.0.0.1  # listen on localhost only
macmon serve -p 8080           # custom port
macmon serve -i 500            # sampling interval 500ms
macmon serve &                 # run in background

Two endpoints are available:

Endpoint Format Description
GET /json JSON Current metrics snapshot (same format as pipe --soc-info)
GET /metrics Prometheus Metrics in Prometheus text format

launchd service

To start macmon serve automatically on login and keep it running:

bash
macmon serve --install                   # install and start (default port 9090)
macmon serve --port 8080 --install       # with custom port
macmon serve --host 127.0.0.1 --install  # listen on localhost only
macmon serve --uninstall                 # stop and remove

This creates a launchd agent at ~/Library/LaunchAgents/com.macmon.plist that auto-starts on login and restarts on crash.

Prometheus and Grafana

The /metrics endpoint exposes metrics in Prometheus format. See examples/grafana for a local demo stack with Prometheus and Grafana.

Prometheus output example
…

Stress testing

Use macmon stress to generate load while checking metric behavior:

bash
macmon stress
macmon stress pulse --duration 30
macmon stress cpu --duration 30
macmon stress cpu --workers 8 --duration 30
macmon stress gpu --duration 30
macmon stress all --duration 30

The default pulse mode generates a predictable cyclic CPU load with a fixed 50% duty cycle on half of the logical CPUs. The cpu and gpu modes continuously load only the selected processor, while all loads both. The cpu and all modes use all logical CPUs unless --workers is specified; --workers has no effect in gpu mode.

Metrics

Output format

The pipe command and the HTTP /json endpoint return the same metrics:

JSON example
…

Active and scaled ratios

active_ratio is the share of the sampling interval during which the processor was doing any work. scaled_ratio is the same measure adjusted for operating frequency, showing the share of the processor's maximum possible capacity that was used.

For interval $T$, $t_i$ is the time spent doing work at frequency $f_i$, and $f_\text{max}$ is the hardware maximum frequency for the CPU cluster or GPU. The product $T f_\text{max}$ is the theoretical maximum frequency-time the processor could deliver at full load without thermal or power throttling:

math
R_\text{active} = \frac{\sum_i t_i}{T}
\qquad
R_\text{scaled} = \frac{\sum_i t_i f_i}{T f_\text{max}}

CPU ratios are calculated per core and averaged across the cluster. A core that did no work contributes zero; combined CPU ratios average all cores from both clusters:

math
R_\text{cluster} = \frac{1}{N_\text{cores}}\sum_j R_j

Examples:

  • Full interval at half the maximum frequency → active = 1.0, scaled = 0.5.
  • Half the interval at the maximum frequency → active = 0.5, scaled = 0.5.
  • One of ten cores working at maximum frequency → cluster active = scaled = 0.1.

Library usage

macmon can be used as a Rust library to collect Apple Silicon metrics in your own applications.

Add it to your project:

bash
cargo add macmon --no-default-features

The default app feature enables the macmon executable and its terminal UI dependencies. Disable default features when using macmon only as a library.

Run the standalone demo app:

bash
cargo run --manifest-path examples/demo-app/Cargo.toml

Then use the Sampler to collect metrics:

…

get_metrics(duration_ms) blocks the calling thread while collecting one IOReport delta over the complete interval. For a UI, server, or async application, create the sampler inside a dedicated worker thread and send the completed metrics back through a channel:

…

Creating Sampler inside the worker keeps its low-level macOS handles on that thread. In an async runtime, use its blocking-thread facility rather than calling get_metrics directly from an executor worker.

Contributing

All contributions are welcome! Feel free to open an issue or submit a pull request.

License

Distributed under the MIT License.

See also

  • tlkh/asitop – The original tool. Written in Python, requires sudo.
  • dehydratedpotato/socpowerbud – Written in Objective-C, sudoless, no TUI.
  • op06072/NeoAsitop – Written in Swift, sudoless.
  • graelo/pumas – Written in Rust, requires sudo.
  • context-labs/mactop – Written in Go, requires sudo.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustapple-siliconclicpucpu-monitoring

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category云原生
PricingOpen source

> Related tools

K
Kubernetes
容器编排事实标准
H
Helm
Kubernetes 包管理器
S
seaweedfs
SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables,