Rename aquatic_load_tester to aquatic_bencher

This commit is contained in:
Joakim Frostegård 2023-12-28 17:42:25 +01:00
parent 6f9b0fce7b
commit af45feb911
10 changed files with 28 additions and 27 deletions

View file

@ -0,0 +1,42 @@
pub mod common;
pub mod protocols;
pub mod run;
pub mod set;
use clap::{Parser, Subcommand};
use common::CpuMode;
#[derive(Parser)]
#[command(author, version, about)]
struct Args {
/// How to choose which virtual CPUs to allow trackers and load test
/// executables on
#[arg(long, default_value_t = CpuMode::Split)]
cpu_mode: CpuMode,
/// Minimum number of tracker cpu cores to run benchmarks for
#[arg(long)]
min_cores: Option<usize>,
/// Maximum number of tracker cpu cores to run benchmarks for
#[arg(long)]
max_cores: Option<usize>,
#[command(subcommand)]
command: Command,
}
#[derive(Subcommand)]
enum Command {
/// Benchmark UDP BitTorrent trackers aquatic_udp and opentracker
#[cfg(feature = "udp")]
Udp(protocols::udp::UdpCommand),
}
fn main() {
let args = Args::parse();
match args.command {
#[cfg(feature = "udp")]
Command::Udp(command) => command
.run(args.cpu_mode, args.min_cores, args.max_cores)
.unwrap(),
}
}