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.
20 lines
478 B
TOML
20 lines
478 B
TOML
[package]
|
|
name = "sccache-dash"
|
|
description = "Records sccache's counters and serves a dashboard for them on localhost"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
|
|
[dependencies]
|
|
sccache-dash-api = { path = "../api" }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
tiny_http = "0.12"
|
|
rusqlite = { version = "0.37", features = ["bundled"] }
|
|
wait-timeout = "0.2"
|
|
dirs = "6"
|
|
include_dir = "0.7"
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|