MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / execute_benchmarks

Function execute_benchmarks

crates/exec-harness/src/lib.rs:62–77  ·  view source on GitHub ↗

Execute benchmark commands

(
    commands: Vec<BenchmarkCommand>,
    measurement_mode: Option<MeasurementMode>,
)

Source from the content-addressed store, hash-verified

60
61/// Execute benchmark commands
62pub fn execute_benchmarks(
63 commands: Vec<BenchmarkCommand>,
64 measurement_mode: Option<MeasurementMode>,
65) -> Result<()> {
66 let measurement_mode = measurement_mode.unwrap_or(MeasurementMode::Walltime);
67 // SAFETY: exec-harness is single-threaded here. No thread has been spawned
68 // yet and InstrumentHooks is only created later, inside `perform`.
69 unsafe { runtime_env::apply(measurement_mode)? };
70
71 match measurement_mode {
72 MeasurementMode::Walltime => walltime::perform(commands),
73 MeasurementMode::Memory | MeasurementMode::Simulation | MeasurementMode::Telemetry => {
74 analysis::perform(commands)
75 }
76 }
77}

Callers 1

run_cliFunction · 0.85

Calls 2

applyFunction · 0.85
performFunction · 0.50

Tested by

no test coverage detected