pressure — PSI stall pressure: cpu, memory, io
pressure is a LightGUI front-end for the pressure command-line utility from util_box. It reads PSI — pressure stall information — from /proc/pressure and shows it as three needle gauges, a history graph, and a stats table. It is one of the 285 apps in util_boxgui, the project recreating util_box utilities as LightGUI apps, each with a screenshot and a walkthrough on the matching LightGUI doc site. The full source is apps/c/pressure/pressure.cpp in that repo.
Load average tells you how many threads are runnable. It does not tell you whether they are actually getting CPU. A box can show low load and still feel unusable, because tasks are stalled waiting on CPU, memory, or IO — and that is exactly what PSI measures: the share of time lost to stalls. Each resource reports two numbers. "Some" means at least one task stalled; "full" means every non-idle task stalled. A high "some" with a low "full" means some work is waiting; a high "full" means nothing is getting done. On this box — a busy VM host — cpu PSI sits around 60% "some", so the cpu gauge reads high and the note line says SEVERE, exactly like the CLI.
The GUI layout

The window holds five widgets, all placed by hand in code — there is no designer file, and that is deliberate: the app is written the way the LightGUI designer's generated apps are structured, so the code below reads like generated output with the sampling logic swapped in.
- Stall gauges (top): three
InstAnalogGaugeneedle dials showing the current "some" avg10 % (0–100) for cpu, memory, and io — the share of the last 10 seconds lost to stalls for that resource. - History graph (middle): an
XGraphline chart of the three "some" avg10 series over the last 60 samples. The CLI has no history view; this is the GUI's addition, and it makes a rising stall trend visible instead of a single snapshot. - Stats table (below): a
TListViewwith the full numbers per resource — some avg10/60/300, full avg10/60/300, total seconds stalled (some / full), and the CLI's verdict. - Status lines: sample count on top, last-update time and the three current "some" values at the bottom, and the note line under the title showing the worst verdict across the three resources, in the CLI's own words.
One rendering quirk is worth knowing about, because it shows up in the screenshot: InstAnalogGauge draws its title text over the top dial numeral — "cpu %" overlaps the "60" tick label — and its digital value over the bottom numerals. That is the widget's own rendering, not this app's drawing, and it is shared with cpusteal. The numbers are still readable in the table below the gauges, which is where the precise values live.
The source
The sampling logic is a direct port of src/pressure.c from util_box. Each sample reads the same three files — /proc/pressure/{cpu,memory,io} — and parses them with the same sscanf shape, avg10/avg60/avg300/total per some / full line. A missing file is reported as "PSI not available (kernel < 4.20 or not enabled)", exactly like the CLI. The verdicts are the CLI's own thresholds on the avg10 numbers: some >= 20 or full >= 10 is SEVERE, some >= 5 or full >= 2 is noticeable, some >= 1 is mild, otherwise healthy. The history is the GUI's addition — a 60-sample ring of each resource's "some" avg10, drawn as three XGraph line series, the same 60-sample ring shape cpusteal uses for its steal history. The three windows matter because they separate a spike from a condition: avg10 is the last 10 seconds, avg60 the last minute, avg300 the last five. A high avg10 with a low avg300 is a spike that is already passing; a high avg300 means the box has been stalling for minutes and the workload behind it is not going away. The total seconds stalled is the cumulative counter — how much time the resource has lost since boot — and it is the number to watch when a verdict flips between healthy and mild, because it keeps climbing while the averages smooth over the change.
some avg10=<pct> avg60=<pct> avg300=<pct> total=<seconds>
full avg10=<pct> avg60=<pct> avg300=<pct> total=<seconds>The differences from the CLI are the usual ones for a monitor app. The GUI has no --resource / --selftest options — it always shows all three resources and runs until the window closes. The CLI prints one report per run to stdout; the GUI shows it live in the gauges, graph, and table, and echoes the same report to stdout once a second, so the GUI numbers can be checked against the CLI. There are no controls to operate: the window refreshes itself once a second from the moment it opens, and closing the window quits.
Building and running it
g++ -std=c++17 -I/root/lg-review/lightgui/widgets/components -I/root/lg-review/lightgui/widgets -O2 -Wall pressure.cpp -lX11 -o build/pressureThat is the one g++ line from the Makefile — make runs it. It builds clean with no warnings, and needs g++, libx11-dev, and the LightGUI checkout (header-only widgets on raw X11). Under a real X server, or under Xvfb:
Xvfb :97 -screen 0 1024x768x24 &
DISPLAY=:97 ./build/pressureThe CLI equivalent is pressure --resource all, which prints one report per run. The GUI is that report, kept live.
pressure --resource allVerified against the CLI
Verified against the CLI on the same box: a GUI frame and a pressure run in the same second agree exactly — 27/27 checks (some/full avg10/60/300, some/full total seconds, and verdict, for each of cpu, memory, io). PSI averages move on a live box, so a comparison against a CLI run seconds later can drift — cpu some avg10 moved 1.7 points in one such run — and the 27/27 figure is the same-second comparison. The note line carries the CLI's own messages, a warning when stalls climb, or the worst verdict across the three resources once the samples agree. See the util_boxgui repo for the other 284 apps.