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

Function run_cli

crates/exec-harness/src/cli.rs:28–59  ·  view source on GitHub ↗
(argv: I)

Source from the content-addressed store, hash-verified

26}
27
28pub fn run_cli<I, T>(argv: I) -> Result<()>
29where
30 I: IntoIterator<Item = T>,
31 T: Into<OsString> + Clone,
32{
33 env_logger::builder()
34 .parse_env(env_logger::Env::new().filter_or("CODSPEED_LOG", "info"))
35 .format(|buf, record| {
36 use std::io::Write;
37 writeln!(buf, "{}", record.args())
38 })
39 .init();
40
41 debug!("Starting exec-harness with pid {}", std::process::id());
42
43 let args = Args::parse_from(argv);
44 let measurement_mode = args.measurement_mode;
45
46 let commands = match args.command.as_slice() {
47 [single] if single == "-" => read_commands_from_stdin()?,
48 [] => bail!("No command provided"),
49 _ => vec![BenchmarkCommand {
50 command: args.command,
51 name: args.name,
52 walltime_args: args.walltime_args,
53 }],
54 };
55
56 execute_benchmarks(commands, measurement_mode)?;
57
58 Ok(())
59}

Callers 1

mainFunction · 0.70

Calls 2

read_commands_from_stdinFunction · 0.85
execute_benchmarksFunction · 0.85

Tested by

no test coverage detected