pub struct Baseline {
rows: BTreeMap<RowKey, Vec<u64>>,
}Expand description
A previous run of this harness, read back as the samples it recorded.
Fields§
§rows: BTreeMap<RowKey, Vec<u64>>Implementations§
Source§impl Baseline
impl Baseline
Sourcepub fn parse(text: &str) -> Result<Baseline, String>
pub fn parse(text: &str) -> Result<Baseline, String>
Reads a baseline from this harness’s own JSONL output.
This parses the format this file writes and nothing else. It is not a
JSON parser and does not pretend to be one: it looks for the three
string fields that name a row and for the sample array inside
wall_ns, and it skips any line that does not carry all four. Lines
that legitimately do not — an unsupported refusal, a
trace_overhead ratio, a comparison from an earlier run — are
therefore skipped rather than treated as errors.
A baseline written by an older build, before samples was reported,
parses as empty. That is the wanted behaviour: comparing against
summaries would mean inventing the spread that made them.
Sourcepub fn samples(
&self,
benchmark: &str,
kind: &str,
backend: &str,
) -> Option<&[u64]>
pub fn samples( &self, benchmark: &str, kind: &str, backend: &str, ) -> Option<&[u64]>
The samples recorded for one row, if the baseline has it.
A row the baseline does not have is not an error: benchmarks are added and the VM learns to run ones it previously refused, and a baseline taken before either is still a baseline for every row it does have.