benchmark_result.rs
This file
Path
src/benchmark/benchmark_result.rs
51 lines · 1.8 KiB · Rust
Last changed by
Add --env for benchmark environment overridesDavid Peterbefore adoption6dddb02
History of this fileTake it
The walk stopped after 200 commits: lines older than 0f91d0c point at it.
Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 1–2why, one step back1use std::collections::BTreeMap;2Merge pull request #790 from sharkdp/new-metricsDavid Peterbefore adoptionf26c015
line 3why, one step back3use serde::Serialize;Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
line 4why, one step back4Merge pull request #969 from sharkdp/codex/result-measurementsDavid Peterbefore adoptione689520
lines 5–6why, one step back5use crate::benchmark::measurement::Measurements;6Merge pull request #790 from sharkdp/new-metricsDavid Peterbefore adoptionf26c015
line 7why, one step back7/// Parameter valueMerge pull request #968 from sharkdp/codex/parameter-metadataDavid Peterbefore adoption05de077
lines 8–12why, one step back8#[derive(Debug, Default, Clone, Serialize, PartialEq)]9pub struct Parameter {10 pub value: String,11}12Merge pull request #969 from sharkdp/codex/result-measurementsDavid Peterbefore adoptione689520
line 13why, one step back13/// Meta data and performance metrics for a single benchmarkMerge pull request #790 from sharkdp/new-metricsDavid Peterbefore adoptionf26c015
line 14why, one step back14#[derive(Debug, Default, Clone, Serialize, PartialEq)]Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
line 15why, one step back15pub struct BenchmarkResult {Merge pull request #790 from sharkdp/new-metricsDavid Peterbefore adoptionf26c015
lines 16–18why, one step back16 /// The command line being benchmarked, after parameter substitution.17 /// For example, `sleep {duration}` with `duration=1` becomes `sleep 1`,18 /// regardless of any custom name.Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 19–20why, one step back19 pub command: String,20Add --env for benchmark environment overridesDavid Peterbefore adoption6dddb02
lines 21–22why, one step back21 /// The custom or automatically generated name after parameter substitution,22 /// if it differs from `command`. Automatic names include environment overrides.Merge pull request #790 from sharkdp/new-metricsDavid Peterbefore adoptionf26c015
lines 23–24why, one step back23 #[serde(skip_serializing_if = "Option::is_none")]24 pub name: Option<String>,Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
line 25why, one step back25Add --env for benchmark environment overridesDavid Peterbefore adoption6dddb02
lines 26–27why, one step back26 /// The name, followed by parameters not used in the command or environment27 /// templates, in command-line order. For example, `sleep {duration}`Merge pull request #790 from sharkdp/new-metricsDavid Peterbefore adoptionf26c015
lines 28–35why, one step back28 /// with `duration=1`, `branch=main`, and the custom name `wait {duration}s`29 /// produces `wait 1s (branch = main)`. Without the custom name, this is30 /// `sleep 1 (branch = main)`. Used in summaries and table exports.31 #[serde(skip_serializing)]32 pub display_name: String,3334 /// Performance metric measurements and exit codes for each run35 #[serde(flatten)]Merge pull request #969 from sharkdp/codex/result-measurementsDavid Peterbefore adoptione689520
line 36why, one step back36 pub measurements: Measurements,Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 37–38why, one step back3738 /// Parameter values for this benchmarkMerge pull request #790 from sharkdp/new-metricsDavid Peterbefore adoptionf26c015
line 39why, one step back39 #[serde(skip_serializing_if = "BTreeMap::is_empty")]Merge pull request #968 from sharkdp/codex/parameter-metadataDavid Peterbefore adoption05de077
line 40why, one step back40 pub parameters: BTreeMap<String, Parameter>,Add --env for benchmark environment overridesDavid Peterbefore adoption6dddb02
lines 41–44why, one step back4142 /// Explicit environment overrides after parameter substitution.43 #[serde(skip_serializing_if = "BTreeMap::is_empty")]44 pub environment: BTreeMap<String, String>,Merge pull request #969 from sharkdp/codex/result-measurementsDavid Peterbefore adoptione689520
lines 45–47why, one step back45}4647impl BenchmarkResult {Merge pull request #790 from sharkdp/new-metricsDavid Peterbefore adoptionf26c015
lines 48–49why, one step back48 pub fn get_name(&self) -> &str {49 self.name.as_deref().unwrap_or(&self.command)Merge pull request #969 from sharkdp/codex/result-measurementsDavid Peterbefore adoptione689520
line 50why, one step back50 }Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
line 51why, one step back51}