Commit Graph
9 Commits
Author SHA1 Message Date
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
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 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 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