pub struct Check {
pub platform: String,
pub baseline_found: bool,
pub lines: Vec<CheckLine>,
pub new_targets: Vec<String>,
pub stale_baseline_targets: Vec<String>,
pub registry_changed: bool,
pub baseline_host: String,
pub current_host: String,
pub current_load: String,
pub baseline_load: String,
pub comparable: bool,
pub budgets: Vec<BudgetLine>,
}Expand description
The outcome of a check.
Fields§
§platform: StringThe platform compared.
baseline_found: boolWas a baseline for this platform found?
lines: Vec<CheckLine>Every comparison.
new_targets: Vec<String>Targets the run measured and the baseline lacks.
stale_baseline_targets: Vec<String>Targets the baseline has and the run did not measure (renamed, removed, or filtered).
registry_changed: boolDid the registry fingerprint change since the baseline?
baseline_host: StringThe host the baseline was recorded on (empty when unknown).
current_host: StringThe host this run measured on.
current_load: StringThe 1-minute load average this run was measured under (empty when unknown).
baseline_load: StringThe 1-minute load average the baseline was recorded under (empty when unknown).
comparable: boolWas the baseline recorded on this host? When not, every line is reported and none fails: wall-clock numbers of two machines are not a regression of either.
budgets: Vec<BudgetLine>Every measurement a budget of the policy bounds, with its verdict. Judged with or without a baseline, and on every host: a bound is absolute.
Implementations§
Source§impl Check
impl Check
Sourcepub fn compare(
run: &ResultDocument,
baseline: Option<&ResultDocument>,
policy: &Policy,
) -> Self
pub fn compare( run: &ResultDocument, baseline: Option<&ResultDocument>, policy: &Policy, ) -> Self
Compare a run with its platform’s baseline under the policy.
Sourcepub fn over_budget(&self) -> bool
pub fn over_budget(&self) -> bool
Is any measurement over its budget? Unlike a regression, this needs no comparable baseline.
use majordomus_cli::bench::baseline::{Check, Policy};
use majordomus_cli::bench::results::{Provenance, ResultDocument};
// a run that measured nothing a budget bounds is over none, with or without a baseline
let run = ResultDocument {
schema: majordomus_cli::bench::RESULT_SCHEMA.into(),
finished_at: "2026-10-12T00:00:00Z".into(),
profile: "ci".into(),
provenance: Provenance {
commit: None,
dirty: false,
build_profile: "debug".into(),
os: "os".into(),
arch: "arch".into(),
version: "0".into(),
registry_fingerprint: "f".into(),
host: "host/1".into(),
load: String::new(),
},
results: Vec::new(),
};
let check = Check::compare(&run, None, &Policy::default());
assert!(check.budgets.is_empty());
assert!(!check.over_budget() && !check.failed());Sourcepub fn measured_under(&self) -> String
pub fn measured_under(&self) -> String
What every verdict of this check was measured under: the runner and its 1-minute load average, and the baseline’s when there is one. A timing verdict is a statement about a machine as much as about a change, so the report never gives one without it.
use majordomus_cli::bench::baseline::{Check, Policy};
use majordomus_cli::bench::results::{Provenance, ResultDocument};
let run = ResultDocument {
schema: majordomus_cli::bench::RESULT_SCHEMA.into(),
finished_at: "2026-10-16T00:00:00Z".into(),
profile: "ci".into(),
provenance: Provenance {
commit: None,
dirty: false,
build_profile: "debug".into(),
os: "os".into(),
arch: "arch".into(),
version: "0".into(),
registry_fingerprint: "f".into(),
host: "runner/4".into(),
load: "31.70".into(),
},
results: Vec::new(),
};
let check = Check::compare(&run, None, &Policy::default());
assert_eq!(check.measured_under(), "runner runner/4, load 31.70");Trait Implementations§
Source§impl<'de> Deserialize<'de> for Check
impl<'de> Deserialize<'de> for Check
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Check
impl JsonSchema for Check
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more