41 Commits
Author SHA1 Message Date
swaitsandClaude Fable 5.2 06abc4de80 Speed panel: say the time is for one crate's compile, not a whole build
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 18:47:40 -07:00
swaitsandClaude Fable 5.2 e3b56cb213 Never start sccache unless asked; compact reasons panel
A server started from the dashboard has the dashboard's environment, not
the builds'. It came up with the 10 GB default beside a 250 GB cache and
sccache trimmed the cache. Starting is now opt-in
(SCCACHE_DASH_START_SCCACHE=1) and the README says why.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 18:32:20 -07:00
swaitsandClaude Fable 5.2 c2b07734c6 Merge compact reasons panel: one line per reason, click to open
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 18:26:16 -07:00
swaitsandClaude Sonnet 5.5 30643390a7 Reasons: one line each, click to open; stack the small panels beside tall reasons
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 18:23:28 -07:00
swaitsandClaude Fable 5.2 0759cbaa25 just shots: screenshots of the whole page at the 3, 2 and 1 column widths
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 18:08:13 -07:00
swaitsandClaude Fable 5.2 29e5103648 Merge scroll fix: a row scrolled above the window ends at its own bottom
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 18:02:52 -07:00
swaitsandClaude Sonnet 5.5 9630b96c1b Fix the page growing while scrolled: close panel rows at their own bottom
end_row folded the panels' bottoms from 0.0, so a row whose bottom was above
the top of the window (negative screen y while scrolled) was closed at y=0.
Everything after it was placed from there, the scroll content grew by the
scroll offset, and the scroll bar kept shrinking at the bottom. The lowest
bottom is now a plain function in fmt with a native test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 18:02:00 -07:00
swaitsandClaude Fable 5.2 f08f4655e4 Shorten the low-hit-rate warning; the fix lives in the reasons panel
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 17:51:30 -07:00
swaitsandClaude Fable 5.2 a8c69567b4 Merge hit-rate advice: what each not-cacheable reason means and what to change
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 17:46:17 -07:00
swaitsandClaude Sonnet 5.5 0f4df265a5 Say what each not-cacheable reason means and what to change; explain a low Rust hit rate
Each reason now carries a plain name, meaning, action and a fixable flag (checked
against sccache 0.18.0), shown with its count in the reasons panel, fixable first.
The low-hit-rate problem names the fixable loss and the Rust hash-key inputs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 17:45:38 -07:00
swaitsandClaude Fable 5.2 4a1dfadfb0 Add a favicon: a gauge in the page's colours
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 17:45:20 -07:00
swaitsandClaude Fable 5.2 3ede855fbb Fix the All languages box: ticking it shows every language again
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 17:27:13 -07:00
swaitsandClaude Fable 5.2 3e76fad51f README: say plainly what it is; it does start sccache
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 15:21:19 -07:00
swaitsandClaude Fable 5.2 0cb8206d43 README: screenshots of the dashboard
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 15:17:07 -07:00
swaits 7e864ad749 Fix round: readable selected segments, panels that fit, smaller fonts
- A selected segment is the accent with white text, in both themes.
- At three columns the row of "Where compiles went", "By language" and
  "Problems" is one modest height; the reasons table is its own panel,
  "Why compiles were not cacheable", stacked under "Speed" beside
  "Over time" and as tall together as it is. In the two-column and
  one-column layouts it follows "Where compiles went".
- Raw counters use every column; each value follows its key by 16 px,
  and a key ends in "..." only where the two do not fit.
- No blank row between a table's head and its first row.
- The five embedded fonts are subset to Latin text and the symbols the
  page uses with pyftsubset (hinting dropped); the wasm goes from
  5.49 MB to 4.11 MB.
2026-11-28 13:40:27 -07:00
swaits 03ffdf887a Merge page redesign: panel grid, instrument-panel theme, Inter and JetBrains Mono 2026-11-28 13:32:53 -07:00
swaits a7d836d45a Redesign the page: a grid of panels with an instrument-panel look
Every colour, size, spacing and font now lives in crates/ui/src/theme.rs.
At 1100 px and wider the page is three columns of panels, at 700 px two,
below that one: a toolbar with the range as one segmented control, a
headline panel, six stat cards in one row, three panels side by side,
then Over time beside Speed, then Raw counters as key/value lines.

The type is Inter and JetBrains Mono (SIL Open Font License, licence
files beside the fonts). Tables size their columns to what they hold,
charts keep their time labels inside the plot and tint unrecorded time,
and the hit-rate bars leave the language table where there is no room.

Behaviour is unchanged: ranges, refresh, theme switch, Copy summary,
Export JSON, Zero stats with its question, the language filter and the
remembered settings work as before.
2026-11-28 13:31:51 -07:00
swaits 72fcf8f976 Merge page polish: full-range charts, even cards, aligned tables 2026-11-28 12:49:48 -07:00
swaits 73c8138072 Page polish from the live service
- 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.
2026-11-28 12:49:21 -07:00
swaits d7351a5d5e Merge fix: history survives a restart; first histogram is immediate 2026-11-28 12:34:57 -07:00
swaitsandClaude Sonnet 5.5 c56aaefa72 History: resume the saved tracker at start; first build observations draw at once
The polling task never loaded the tracker the last run saved, so every
restart began again from a baseline and dropped what had not yet reached a
row. The empty bootstrap drawn at the first poll also started the one-minute
wait for the first real observations.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 12:34:30 -07:00
swaitsandClaude Fable 5.2 bcc178330b Lock file with the page crate; ignore local agent notes
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 12:24:58 -07:00
swaits f277737e12 Merge page: egui dashboard for the browser 2026-11-28 12:14:19 -07:00
swaits 46b8dcf274 Hit-rate chart: a mark every quarter, so the axis reads 0% to 100% 2026-11-28 12:13:45 -07:00
swaits dc876b5a5c Dashboard page: fit the page, five shares, build-time histograms
- 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.
2026-11-28 12:10:01 -07:00
swaits e282b40a18 Merge server round 3: steady cost by count, bootstrap once a minute 2026-11-28 12:09:21 -07:00
swaits 693dca6cdf Prove the steady cost by count, redraw the bootstrap once a minute, tidy
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.
2026-11-28 12:07:56 -07:00
swaits 7ab1543315 Merge server round 2: SQL bucketing, histogram and interval, starts sccache 2026-11-28 11:57:33 -07:00
swaits 16ba94517b Bucket in SQLite, draw the build-time bootstrap once, start sccache's server
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.
2026-11-28 11:57:10 -07:00
swaits 90a6302149 Merge server: polling, SQLite history, views, HTTP, service install 2026-11-28 11:46:54 -07:00
swaits 7f58931b7b Keep the history in SQLite, one view per range made after each poll
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.
2026-11-28 11:44:50 -07:00
swaits c589b7c868 Merge branch 'main' into t3/dashboard-ui-page 2026-11-28 11:41:03 -07:00
swaitsandClaude Fable 5.2 bf04056ae1 Contract: Range helpers, say what misses include
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 11:40:04 -07:00
swaitsandClaude Fable 5.2 4bc60b4d1f Add stats crate to the workspace
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 11:33:28 -07:00
swaits b56564a52a Merge build-time statistics crate 2026-11-28 11:33:28 -07:00
swaitsandClaude Sonnet 5.5 394c7d65f9 Stats crate: build-time histograms and bootstrapped time-saved interval
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 11:32:34 -07:00
swaits b80749ebb5 Dashboard page for sccache-dash (crates/ui)
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.
2026-11-28 11:30:54 -07:00
swaits a83ae5e0d9 Merge branch 'main' into t3/sccache-dash-server 2026-11-28 11:27:18 -07:00
swaits 3cbc02e631 Server half of sccache-dash
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.
2026-11-28 11:23:39 -07:00
swaitsandClaude Fable 5.2 8fb4d64494 Contract: build-time histogram per language, 90% interval on time saved
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 11:21:56 -07:00
swaitsandClaude Fable 5.2 a8e7bd66cf Data contract between server and page, live stats fixture
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-28 10:40:26 -07:00