mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
load tester: refactor, add udp sets, improve docs, add command options
This commit is contained in:
parent
7b6bb12c9e
commit
0317053f80
6 changed files with 354 additions and 196 deletions
|
|
@ -4,16 +4,28 @@ 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 load tests for
|
||||
#[arg(long)]
|
||||
min_cores: Option<usize>,
|
||||
/// Maximum number of tracker cpu cores to run load tests 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),
|
||||
}
|
||||
|
|
@ -23,6 +35,8 @@ fn main() {
|
|||
|
||||
match args.command {
|
||||
#[cfg(feature = "udp")]
|
||||
Command::Udp(command) => command.run().unwrap(),
|
||||
Command::Udp(command) => command
|
||||
.run(args.cpu_mode, args.min_cores, args.max_cores)
|
||||
.unwrap(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue