- Both charts always span exactly the selected range, edge to edge. Time
nothing was recorded in is shaded and labelled once, and each chart's
key is drawn under the chart instead of over the data.
- The time saved says "not enough data yet" or "nothing saved yet"
when nothing can be counted, and a saving under a second reads
"under 1 s", never in milliseconds.
- The six cards are exact boxes of one size, so their tops line up.
- Tables have headed columns at fixed shares of the width, text left and
numbers right; each row is one rectangle with a place for every cell.
- The cache usage bar has an outlined track.
- When the server can't be reached, the notice is drawn over the page, so
what is on screen keeps its place and height.
- Built is the miss count, as sccache counts timeouts, cache errors and
forced recaches inside it. The bar under the headline has five shares
that add up to every compiler call and always to 100%; what happened
inside the built share is one line under the bar.
- The time saved shows its 90% range in small print under the figure.
- Speed gains "How long builds take, by language": one fixed-height
histogram per language on a shared log scale of build time, with the
mean, median and p90 marked.
- The api crate's Range helpers replace the page's own copies.
- Drawing is built only for the browser, so the tests (and the rest of
the crate) build anywhere without eframe's native backends.
- Tables are drawn row by row; egui's Grid lost its rows when a cell
held more than a plain widget. Fold-away bodies are held to the width
of the page, and the charts fit their data every frame.
- mise.toml takes trunk 0.22.2 as a release binary; building it from
source took over half an hour.
A test fills a history with a row a minute for thirty days (43,199 rows,
4,319 build observations) in one transaction, runs two polls and asserts
the second hands out fewer than 3,000 rows; it measures 1,567 (the first
reads every observation once). History::fill saves a run of readings as
the polls would have.
While a build keeps adding observations, they are stored at once but the
bootstrap and the histogram are redrawn at most once a minute.
A saving is never negative or a negative zero.
History::rows and History::build_observations are gone, with the tests
that only used them. History::first_row stays: without it the chart of
the reset range, on a database that never saw a zeroing, would start at
the live reading instead of at the first row.
The timing line is logged for the first two polls.
Speed: the chart's counts come from GROUP BY over the bucket number, so
about 120 rows per table per range reach Rust instead of every saved row;
a range total is one indexed SUM. History counts the rows it hands out.
Build times: crates/stats gains Resampled, which draws the bootstrap once
for a set of languages and applies it to any number of hit sets; the
server keeps it and redraws only when an observation was added. The
views fill build_times, time saved and the 90% interval from the stats
crate, and the time-saved arithmetic of the server is gone.
Starting sccache: when nothing listens where the client looks
(SCCACHE_SERVER_UDS, or 127.0.0.1 at SCCACHE_SERVER_PORT), sccache
--start-server is run once and the counters read again; a failure is
reported as NotRunning and not retried for a minute.
Uses the api's Range::ALL, parse and label.
Each row of the readings table is the difference since the row before it,
at most one a minute and only when something changed, so a range total is
one indexed query. Per-language counts, not-cacheable reasons and build
observations have their own tables; what the last poll and the last row
saw is remembered in the state table, so differences survive a restart.
The five views are computed once per poll and kept; /api/view answers
from them and never touches the database, which only the polling task
holds. /api/zero wakes that task instead of reading the counters itself.
Build observations: after a poll in which every build that finished was
of one language, one row with the difference in compilations and compile
time, for the build-time histogram. Time saved uses their per-language
average. Views fill the api's build_times and interval_90 as empty/None.
An eframe/egui page compiled to WebAssembly with trunk. It draws the one
View the server sends: controls on top, three big figures, six cards, and
the collapsible sections Problems, Where compiles went, Over time, Speed,
Extras and Raw counters. The range, refresh interval and theme are
remembered between visits with eframe storage.
mise.toml names trunk 0.22.2 as the build tool.
Polls sccache's counters every 10 s, keeps a JSON-lines history, and serves
the page and its API on 127.0.0.1: one difference-with-reset mechanism behind
every range, per-language time saved, problems, a copyable summary, and
extra tables for multi-level and distributed caches.
The page is embedded from crates/ui/dist when it exists, with a placeholder
until then. POST /api/zero refuses foreign Host and Origin headers.
Tests run against a stand-in sccache script; sample fixtures for the
multi-level and distributed shapes are made up.