mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
bencher: add args duration and summarize_last (seconds)
This commit is contained in:
parent
7863782413
commit
85862f161a
4 changed files with 65 additions and 42 deletions
|
|
@ -6,6 +6,7 @@ pub mod set;
|
|||
|
||||
use clap::{Parser, Subcommand};
|
||||
use common::{CpuMode, Priority};
|
||||
use set::run_sets;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(author, version, about)]
|
||||
|
|
@ -23,6 +24,17 @@ struct Args {
|
|||
/// Minimum benchmark priority
|
||||
#[arg(long, default_value_t = Priority::Medium)]
|
||||
min_priority: Priority,
|
||||
/// How long to run each load test for
|
||||
#[arg(long, default_value_t = 60)]
|
||||
duration: usize,
|
||||
/// Only include data for last N seconds of load test runs.
|
||||
///
|
||||
/// Useful if the tracker/load tester combination is slow at reaching
|
||||
/// maximum throughput
|
||||
///
|
||||
/// 0 = use data for whole run
|
||||
#[arg(long, default_value_t = 0)]
|
||||
summarize_last: usize,
|
||||
#[command(subcommand)]
|
||||
command: Command,
|
||||
}
|
||||
|
|
@ -39,13 +51,21 @@ fn main() {
|
|||
|
||||
match args.command {
|
||||
#[cfg(feature = "udp")]
|
||||
Command::Udp(command) => command
|
||||
.run(
|
||||
Command::Udp(command) => {
|
||||
let sets = command.sets(args.cpu_mode);
|
||||
let load_test_gen = protocols::udp::UdpCommand::load_test_gen;
|
||||
|
||||
run_sets(
|
||||
&command,
|
||||
args.cpu_mode,
|
||||
args.min_cores,
|
||||
args.max_cores,
|
||||
args.min_priority,
|
||||
)
|
||||
.unwrap(),
|
||||
args.duration,
|
||||
args.summarize_last,
|
||||
sets,
|
||||
load_test_gen,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue