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

Function perform

crates/exec-harness/src/analysis/mod.rs:15–37  ·  view source on GitHub ↗
(commands: Vec<BenchmarkCommand>)

Source from the content-addressed store, hash-verified

13mod preload_lib_file;
14
15pub fn perform(commands: Vec<BenchmarkCommand>) -> Result<()> {
16 let hooks = InstrumentHooks::instance(INTEGRATION_NAME, INTEGRATION_VERSION);
17
18 for benchmark_cmd in commands {
19 let name_and_uri = uri::generate_name_and_uri(&benchmark_cmd.name, &benchmark_cmd.command);
20 name_and_uri.print_executing();
21
22 let mut cmd = Command::new(&benchmark_cmd.command[0]);
23 cmd.args(&benchmark_cmd.command[1..]);
24 hooks.start_benchmark().unwrap();
25 let status = cmd.status();
26 hooks.stop_benchmark().unwrap();
27 let status = status.context("Failed to execute command")?;
28
29 if !status.success() {
30 bail!("Command exited with non-zero status: {status}");
31 }
32
33 hooks.set_executed_benchmark(&name_and_uri.uri).unwrap();
34 }
35
36 Ok(())
37}
38
39/// Executes the given benchmark commands using a preload based trick to handle valgrind control.
40///

Callers

nothing calls this directly

Calls 6

generate_name_and_uriFunction · 0.85
print_executingMethod · 0.80
argsMethod · 0.80
start_benchmarkMethod · 0.45
stop_benchmarkMethod · 0.45

Tested by

no test coverage detected