Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/cli/exec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ fn build_orchestrator_config(
poll_results_options,
extra_env: HashMap::new(),
fair_sched: args.shared.experimental.experimental_fair_sched,
cycle_estimation: args.shared.experimental.cycle_estimation,
cycle_estimation: args.shared.experimental.experimental_cycle_estimation,
exclude_allocations: args.shared.experimental.experimental_exclude_allocations,
})
}

Expand Down
20 changes: 16 additions & 4 deletions src/cli/experimental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@ pub struct ExperimentalArgs {
long,
default_value_t = false,
help_heading = "Experimental",
env = "CODSPEED_CYCLE_ESTIMATION"
env = "CODSPEED_EXPERIMENTAL_CYCLE_ESTIMATION"
)]
pub cycle_estimation: bool,
pub experimental_cycle_estimation: bool,

/// Exclude memory allocation time from simulation results.
#[arg(
long,
default_value_t = false,
help_heading = "Experimental",
env = "CODSPEED_EXPERIMENTAL_EXCLUDE_ALLOCATIONS"
)]
pub experimental_exclude_allocations: bool,
}

impl ExperimentalArgs {
Expand All @@ -34,8 +43,11 @@ impl ExperimentalArgs {
if self.experimental_fair_sched {
flags.push("--experimental-fair-sched");
}
if self.cycle_estimation {
flags.push("--cycle-estimation");
if self.experimental_cycle_estimation {
flags.push("--experimental-cycle-estimation");
}
if self.experimental_exclude_allocations {
flags.push("--experimental-exclude-allocations");
}
flags
}
Expand Down
6 changes: 4 additions & 2 deletions src/cli/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ impl RunArgs {
},
experimental: ExperimentalArgs {
experimental_fair_sched: false,
cycle_estimation: false,
experimental_cycle_estimation: false,
experimental_exclude_allocations: false,
},
},
instruments: vec![],
Expand Down Expand Up @@ -128,7 +129,8 @@ fn build_orchestrator_config(
poll_results_options,
extra_env: HashMap::new(),
fair_sched: args.shared.experimental.experimental_fair_sched,
cycle_estimation: args.shared.experimental.cycle_estimation,
cycle_estimation: args.shared.experimental.experimental_cycle_estimation,
exclude_allocations: args.shared.experimental.experimental_exclude_allocations,
})
}

Expand Down
6 changes: 6 additions & 0 deletions src/executor/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ pub struct OrchestratorConfig {
pub fair_sched: bool,
/// Enable valgrind's --cycle-estimation option.
pub cycle_estimation: bool,
/// Signal the backend to exclude memory allocation time from simulation results.
pub exclude_allocations: bool,
}

/// Per-execution configuration passed to executors.
Expand Down Expand Up @@ -128,6 +130,8 @@ pub struct ExecutorConfig {
pub fair_sched: bool,
/// Enable valgrind's --cycle-estimation option.
pub cycle_estimation: bool,
/// Signal the backend to exclude memory allocation time from simulation results.
pub exclude_allocations: bool,
}

#[derive(Debug, Clone, PartialEq)]
Expand Down Expand Up @@ -198,6 +202,7 @@ impl OrchestratorConfig {
enable_introspection,
fair_sched: self.fair_sched,
cycle_estimation: self.cycle_estimation,
exclude_allocations: self.exclude_allocations,
}
}
}
Expand Down Expand Up @@ -231,6 +236,7 @@ impl OrchestratorConfig {
extra_env: HashMap::new(),
fair_sched: false,
cycle_estimation: false,
exclude_allocations: false,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/run_environment/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ pub trait RunEnvironmentProvider {
version: crate::VERSION.into(),
instruments: config.instruments.get_active_instrument_names(),
executor: executor_name,
exclude_allocations: config.exclude_allocations,
system_info: system_info.clone(),
},
run_environment: self.get_run_environment(),
Expand Down
7 changes: 7 additions & 0 deletions src/upload/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ pub struct Runner {
pub version: String,
pub instruments: Vec<InstrumentName>,
pub executor: ExecutorName,
/// Whether memory allocation time is excluded from results. Part of the run's
/// measurement configuration: runs with different values are not comparable.
///
/// Skipped when `false` so the default payload stays byte-identical to runs
/// without this feature, keeping the metadata hash and version unchanged.
#[serde(skip_serializing_if = "std::ops::Not::not")]
pub exclude_allocations: bool,
Comment thread
greptile-apps[bot] marked this conversation as resolved.
#[serde(flatten)]
pub system_info: SystemInfo,
}
Expand Down
2 changes: 2 additions & 0 deletions src/upload/upload_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ mod tests {
version: "2.1.0".into(),
instruments: vec![InstrumentName::MongoDB],
executor: ExecutorName::Valgrind,
exclude_allocations: false,
system_info: SystemInfo::test(),
},
run_environment: RunEnvironment::GithubActions,
Expand Down Expand Up @@ -95,6 +96,7 @@ mod tests {
version: "4.11.1".into(),
instruments: vec![],
executor: ExecutorName::Valgrind,
exclude_allocations: false,
system_info: SystemInfo {
os: crate::system::SupportedOs::Linux(
crate::system::LinuxDistribution::Other {
Expand Down
Loading