Rename to command
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Peter · committed by David Peter · parent 4cfccf1 · Browse files · 1 file·+11 added−11 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+11 added−11 removed
- other:+11 added−11 removed
Provenance
- Commit
0b5ad72- Tree
b74589e- Author
David Peter <mail@david-peter.de>- Committer
David Peter <sharkdp@users.noreply.github.com>- Parent
4cfccf1
1 file changed+11 added−11 removed
modified:src/benchmark/scheduler.rs+11 added-11 removed
24 unmodified lines25 use crate::util::units::Second;26 27 use anyhow::{bail, Result};28 29-///////////////29+/////////////// TODO: refactor the following part30 31 /// Correct for shell spawning time32 fn subtract_shell_spawning_time(time: Second, shell_spawning_time: Second) -> Second {33 if time < shell_spawning_time {266 unmodified lines300 301 self.run_intermediate_command(command, error_output)302 }303 304- /// Run the benchmark for a single shell command304+ /// Run the benchmark for a single command305 pub fn run_benchmark(306 &self,307 benchmark_number: usize,308- cmd: &Command<'_>,308+ command: &Command<'_>,309 shell_spawning_time: TimingResult,310 ) -> Result<BenchmarkResult> {311- let command_name = cmd.get_name();311+ let command_name = command.get_name();312 if self.options.output_style != OutputStyleOption::Disabled {313 println!(314 "{}{}: {}",315 "Benchmark ".bold(),16 unmodified lines332 };333 Command::new_parametrized(334 None,335 preparation_command,336- cmd.get_parameters().iter().cloned(),336+ command.get_parameters().iter().cloned(),337 )338 });339 340- self.run_setup_command(cmd.get_parameters().iter().cloned())?;340+ self.run_setup_command(command.get_parameters().iter().cloned())?;341 342 // Warmup phase343 if self.options.warmup_count > 0 {344 let progress_bar = if self.options.output_style != OutputStyleOption::Disabled {9 unmodified lines354 for _ in 0..self.options.warmup_count {355 let _ = self.run_preparation_command(&prepare_cmd)?;356 let _ = time_shell_command(357 &self.options.shell,358- cmd,358+ command,359 self.options.command_output_policy,360 self.options.command_failure_action,361 None,362 )?;21 unmodified lines384 385 // Initial timing run386 let (res, status) = time_shell_command(387 &self.options.shell,388- cmd,388+ command,389 self.options.command_output_policy,390 self.options.command_failure_action,391 Some(shell_spawning_time),392 )?;47 unmodified lines440 }441 442 let (res, status) = time_shell_command(443 &self.options.shell,444- cmd,444+ command,445 self.options.command_output_policy,446 self.options.command_failure_action,447 Some(shell_spawning_time),448 )?;105 unmodified lines554 if self.options.output_style != OutputStyleOption::Disabled {555 println!(" ");556 }557 558- self.run_cleanup_command(cmd.get_parameters().iter().cloned())?;558+ self.run_cleanup_command(command.get_parameters().iter().cloned())?;559 560 Ok(BenchmarkResult {561 command: command_name,562 mean: t_mean,4 unmodified lines567 min: t_min,568 max: t_max,569 times: Some(times_real),570 exit_codes,571- parameters: cmd571+ parameters: command572 .get_parameters()573 .iter()574 .map(|(name, value)| ((*name).to_string(), value.to_string()))575 .collect(),3 unmodified lines