Skip to content

Commit 238398e

Browse files
committed
feat(cargo-codspeed): add analysis build mode
1 parent 56ca6f0 commit 238398e

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

crates/cargo-codspeed/src/build.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ See `cargo codspeed build --help` for more information.");
225225
"-Cstrip=none".to_owned(),
226226
];
227227

228-
// Add the codspeed cfg flag if simulation mode is enabled
229-
if measurement_mode == MeasurementMode::Simulation {
228+
// Add the codspeed cfg flag if the benchmark should only run once
229+
if measurement_mode == MeasurementMode::Simulation
230+
|| measurement_mode == MeasurementMode::Analysis
231+
{
230232
flags.push("--cfg=codspeed".to_owned());
231233
}
232234

crates/cargo-codspeed/src/measurement_mode.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ pub enum MeasurementMode {
99
#[value(alias = "instrumentation")]
1010
Simulation,
1111
Walltime,
12+
#[value(alias = "memory")]
13+
Analysis,
1214
}
1315

1416
impl fmt::Display for MeasurementMode {
@@ -19,6 +21,7 @@ impl fmt::Display for MeasurementMode {
1921
match self {
2022
MeasurementMode::Simulation => "simulation",
2123
MeasurementMode::Walltime => "walltime",
24+
MeasurementMode::Analysis => "analysis",
2225
}
2326
)
2427
}

0 commit comments

Comments
 (0)