pub struct Surface {
pub id: String,
pub mount: String,
pub kind: String,
pub routes: usize,
pub families: usize,
pub sampled: usize,
pub truncated: bool,
}Expand description
One surface the audit measured, and what it contributed.
A built surface is a directory, and every page of it is visited. A surface the executable renders has no directory: its routes are crawled out of its own anchors and a sample of each family is visited, so the number of routes it has is reported beside the number that was sampled. A sample rendered as a total would be a report overstating its own coverage, and the Cockpit’s thousands of routes are why that distinction belongs on the page rather than in somebody’s head.
use majordomus_cli::web::report::ui::{parse, Surface};
let run = parse(r#"{"schema":"ui-audit/v1","pages":108,"visits":478,"findings":[],
"surfaces":[{"id":"cockpit","mount":"/cockpit","kind":"native-route",
"routes":2660,"families":14,"sampled":108}]}"#).unwrap();
let surface: &Surface = &run.surfaces[0];
assert_eq!((surface.routes, surface.sampled), (2660, 108));
assert!(!surface.truncated, "a crawl that hit its budget reports a floor, not a total");Fields§
§id: StringThe surface’s id in the topology.
mount: StringWhere the executable serves it.
kind: Stringstatic-directory or native-route.
routes: usizeHow many routes the surface has, when they were crawled rather than read from disk.
families: usizeHow many families those routes fell into.
sampled: usizeHow many of them the audit visited.
truncated: boolWhether the crawl hit its budget, so the route count is a floor rather than a total.