Skip to content
◀ Blog

How to see CPU usage history on a Mac

Activity Monitor only shows live CPU data. Here is how to find what used your Mac's CPU earlier, log it from Terminal, or keep weeks of history.

Riley Hilliard9 min read

macoscli

macOS doesn’t keep a per-process CPU usage history you can look back through. Activity Monitor shows what is running now, and its graphs cover only the time it has been open. If your fans spun up an hour ago and have since gone quiet, you can still get partial answers from what’s running and from the reports macOS writes on its own. To see CPU usage history on a Mac properly, you have to start recording before the next spike, either with a small Terminal loop or with a monitor app that stores history.

Can Activity Monitor show CPU usage history?

Only a little. Activity Monitor is a live view. The CPU tab lists processes by their current % CPU, and the load graph at the bottom of the window scrolls through recent seconds. Two other views look like history but aren’t per process:

  • Window > CPU History opens a graph of load on each core. It covers the time Activity Monitor has been running and shows no process names.
  • View > Dock Icon > Show CPU History turns the Dock icon into a small live load graph, with the same limits.

Neither tells you which process was busy at 3pm. Quit Activity Monitor and the graphs start over the next time you open it.

The CPU tab does have one column that reaches into the past: CPU Time, the total processor time a process has used since it started. Sort by it and a process that ran hot for ten minutes will sit near the top even after it calms down. It only works for processes that are still running, and long-lived processes such as WindowServer collect a lot of CPU time just by being up for days, so compare against how long each has been running.

The Energy tab’s 12 hr Power column is the other backward-looking number. It averages each app’s energy impact over the last 12 hours (or since startup). Energy impact isn’t CPU percentage, and it’s grouped by app, but a background app with an unexpectedly high 12-hour figure is a good lead.

How do you find what spun up your Mac’s fans?

Start with what’s still running, then check what macOS recorded on its own.

  1. Open Activity Monitor, go to the CPU tab, and sort by CPU Time. Look for anything you don’t expect near the top.
  2. Sort by % CPU. If the fans are still going, the culprit is usually visible here.
  3. Look in /Library/Logs/DiagnosticReports (also listed under Reports in the Console app) for files with cpu_resource in the name. macOS writes one when a process uses a lot of CPU over a sustained stretch, and the report names the process and the time.

Some processes show up in these lists often enough to recognize:

Process What it is
mds_stores, mdworker Spotlight indexing, common after an update or after copying in a lot of files
backupd Time Machine
photoanalysisd Photos analyzing your library
kernel_task macOS itself; high usage here often means it’s managing heat
Browser helper processes Individual tabs; the parent app’s name doesn’t always tell you which one

The unified log can confirm a suspect once you have one. It records events, not CPU percentages, but it can show you that Time Machine was running when the fans started:

log show --last 1h --style compact --predicate 'process == "backupd"'

Swap in another process name to check a different suspect.

How do you log CPU usage from the terminal?

The built-in command-line tools only report the current moment. To get history, run one on a schedule and append its output to a file. This loop records the top five processes by CPU every 30 seconds:

while true; do
  date "+%F %T"
  ps -Ao pcpu,pid,comm -r | head -n 6
  sleep 30
done >> ~/cpu.log

ps -r sorts by CPU usage, and pcpu is a recent average rather than a single instant, so a short burst still shows up. Leave it running in a Terminal tab, and the next time the fans spin up, open ~/cpu.log and look at the timestamps around that moment. If you want it to survive restarts, wrap the same commands in a launchd agent.

top works for one-off snapshots. In logging mode the first sample’s CPU percentages aren’t meaningful, so ask for two samples and read the second:

top -l 2 -o cpu -n 10 -stats pid,command,cpu

On Apple Silicon, powermetrics reports per-process CPU usage alongside power and thermal readings. It needs sudo:

sudo powermetrics --samplers tasks,cpu_power,thermal -i 5000 -n 1

-i is the sample interval in milliseconds and -n is the number of samples. Drop -n and redirect the output to a file to keep it running. It’s the most detailed of the three tools and the noisiest to read back.

With any of them, nothing is recorded until you set it up, the log grows until you trim it, and reading it back means scrolling a text file to find the right minute.

What should a Mac monitor record?

Per-process detail matters most. A graph of total CPU load tells you that something happened at 3pm. Only process names tell you what it was, so the monitor has to store which processes were busy along with the totals.

It should also record more than CPU. Fans respond to temperature and power draw, and on Apple Silicon the GPU can heat the machine while the CPU sits nearly idle. Memory pressure and disk activity explain the slowdowns that aren’t about heat.

Retention has to be measured in days. A spike you only notice the next morning, or one that happens every afternoon, needs more than the last hour. With that much data you also need a way to jump to the moment, such as events marked on the timeline when the fans ramp or a process pins a core, because scrolling raw samples is slow.

The monitor also has to be cheap to run, or it becomes one of the busy processes you’re investigating.

How do you keep 30 days of system history?

We built StatGlass for this. It’s a free, open-source (Apache-2.0) menu bar monitor for Apple Silicon Macs. It reads CPU, GPU, memory, power and sensors, network, disk and battery, records them locally, and keeps up to 30 days of history.

StatGlass / menu bar
LOCALREADY

The popover on simulated data. Open a card for detail, or its ↗ for that page of the dashboard.

StatGlass

MacBook Pro · up 3d 4h

Held
↗7%
↗14.9 / 24 GB
Pressure · normal
↗4%
↗6.1 W system
87% · On battery
↗↑ 45 KB/s · ↓ 296 KB/s

Simulated readings, one sample a second. The dashboard links open StatGlass's own web demo in a new tab.

Fig. 1 StatGlass's menu bar popover, sampling a simulated MacBook Pro once a second. Open a card for detail. Source: simulated data

The Timeline shows every module on one chart over the last hour, 24 hours, 7 days or 30 days, and marks events on it: fans ramping, thermal state changes, a process pinning the CPU, and power spikes. Select an interval to zoom in, and the recorded app usage panel lists the top ten app groups for that range, sortable by CPU, GPU, RAM, estimated CPU power or network, with the individual processes underneath. A heatmap shows CPU load or temperature by hour, which makes a daily pattern easy to spot. Any range exports to CSV.

How long the history lasts depends on disk use. The default limit is 750 MB, adjustable in Settings. StatGlass keeps 10-second buckets for 24 hours, one-minute buckets through 7 days, and 15-minute buckets through 30 days. Per-process detail is kept for processes that used at least 0.1% of a core, any GPU, or 100 MB of RAM, while app totals include every process. When history fills the limit, old process detail goes first, so 30 days isn’t guaranteed on a busy machine. Time when the Mac is asleep or StatGlass isn’t running shows as a gap in the charts.

With only the menu bar showing, it samples every 2 seconds. With a window open it samples every second, adjustable from 0.5 to 60 seconds. On an M3 Max with default settings, the menu-bar-only state measured 0.67% of one core and 105 MB of memory; with a window open it uses 6 to 10%, depending on the page. Local monitoring runs as your user without a privileged helper, and history stays in ~/Library/Application Support/com.tryopendata.statglass/. There is no StatGlass backend; the app contacts GitHub only to check for updates.

It needs an M1 or newer on macOS 26 or later. Intel Macs aren’t supported, because the power and sensor readings come from interfaces only Apple Silicon has. It’s signed with a Developer ID and notarized by Apple, so macOS only asks you to confirm opening an app downloaded from the internet.

Can you monitor other Macs and Linux servers too?

Yes, over SSH. From Hosts > Add Mac in StatGlass, you can add another Apple Silicon Mac that has Remote Login turned on and your SSH key authorized. Setup installs StatGlass on that Mac and turns on remote monitoring there. You then see its live metrics and a mirrored copy of its history, while settings and alerts stay local.

Linux servers work the same way through an SSH alias or user@address. StatGlass bundles static agents for x86_64 and aarch64 Linux and installs one as a systemd service (a user service for a normal account, a system service for root), so the host needs systemd. Sensor, power and container details depend on the server’s hardware and permissions.

For containers on your own Mac, StatGlass can watch one local Docker engine by reading its Unix socket directly, with no Docker CLI needed. It records CPU, memory and I/O history for up to 128 containers, shows logs, and has a storage view for reviewing unused images, volumes and build cache before you remove them.

Remote monitoring is the one case where data leaves the Mac: SSH clients you authorize can read that host’s metrics and history. The connection is plain SSH, with no StatGlass service in between.