feat(client): add --no-test option for negotiation-only runs

This commit is contained in:
Nils Andreas Svee committed 2026-10-21 15:35:21 +07:00
1 parent 56fe30d0e2
commit d2a7acdec4
4 files changed
+40 -4

No files matched your search

+3
View File
@@ -104,6 +104,9 @@ Probe a server:
```sh ```sh
irtt-client netperf-eu.bufferbloat.net:2112 --duration 30s --interval 100ms irtt-client netperf-eu.bufferbloat.net:2112 --duration 30s --interval 100ms
# Negotiate parameters without sending measurement probes
irtt-client --no-test netperf-eu.bufferbloat.net:2112
``` ```
Probe continuously until interrupted (`Ctrl-C`): Probe continuously until interrupted (`Ctrl-C`):
+15 -2
View File
@@ -31,6 +31,15 @@ pub struct ClientArgs {
)] )]
pub targets_stdin: bool, pub targets_stdin: bool,
/// Negotiate parameters and exit without sending measurement probes.
#[arg(
short = 'n',
long,
conflicts_with = "targets_stdin",
long_help = "Negotiate parameters with each target and exit without sending measurement probes. Duration options still set the requested duration, but do not keep this mode running. Reports negotiated parameters using the selected output format, without a measurement summary."
)]
pub no_test: bool,
/// Managed group pacing for multi-target mode. /// Managed group pacing for multi-target mode.
#[arg( #[arg(
long, long,
@@ -106,7 +115,7 @@ impl ClientArgs {
if self.targets_stdin && !self.is_continuous() { if self.targets_stdin && !self.is_continuous() {
return Err("--targets-stdin requires --continuous or --duration 0".to_owned()); return Err("--targets-stdin requires --continuous or --duration 0".to_owned());
} }
prepare_managed_run( let mut setup = prepare_managed_run(
&self.common, &self.common,
if self.continuous { if self.continuous {
Duration::ZERO Duration::ZERO
@@ -119,7 +128,11 @@ impl ClientArgs {
stdin_controlled: self.targets_stdin, stdin_controlled: self.targets_stdin,
}, },
) )
.await .await?;
if self.no_test {
setup.client.request.run_mode = irtt_client::RunMode::NoTest;
}
Ok(setup)
} }
pub fn is_continuous(&self) -> bool { pub fn is_continuous(&self) -> bool {
+3 -2
View File
@@ -167,7 +167,8 @@ pub async fn run_stream(
}) })
}), }),
}; };
stream_output.print_final_summary = should_print_final_summary(continuous, interrupted); stream_output.print_final_summary =
!args.no_test && should_print_final_summary(continuous, interrupted);
stream_output.show_running_only_summary_note = stream_output.show_running_only_summary_note =
continuous && interrupted && stream_output.print_final_summary; continuous && interrupted && stream_output.print_final_summary;
for target in &setup.targets { for target in &setup.targets {
@@ -733,7 +734,7 @@ fn stats_config(continuous: bool) -> StatsConfig {
} }
} }
fn finite_stats_memory_warning(args: &ClientArgs, target_count: usize) -> Option<String> { fn finite_stats_memory_warning(args: &ClientArgs, target_count: usize) -> Option<String> {
if args.is_continuous() || args.duration.is_zero() { if args.no_test || args.is_continuous() || args.duration.is_zero() {
return None; return None;
} }
let target_count = u64::try_from(target_count).unwrap_or(u64::MAX); let target_count = u64::try_from(target_count).unwrap_or(u64::MAX);
+19
View File
@@ -172,6 +172,25 @@ desired set to 128 targets and retains at most 256 live target generations
while replacements drain. The 128-target limit applies after dual-stack while replacements drain. The 128-target limit applies after dual-stack
expansion: a hostname producing both families consumes two target slots. expansion: a hostname producing both families consumes two target slots.
## NEGOTIATION ONLY
`-n` / `--no-test` connects to each target, negotiates the requested parameters,
and exits without sending measurement probes. For example:
```sh
irtt-client --no-test host.example:2112 --duration 30s --interval 100ms
```
The `no_test_completed` event reports successful negotiation, including the
negotiated duration, interval, and packet length. Output format and column
selection work as usual; no measurement summary or statistics-memory warning
is printed. Negotiation failures use the normal target diagnostics and exit
policy: an uninterrupted run exits nonzero if no target succeeds.
Duration options still specify the duration to negotiate; even with
`--continuous` or `--duration 0`, the client exits after negotiation.
`--no-test` cannot be combined with `--targets-stdin`.
## FINITE VERSUS CONTINUOUS OPERATION ## FINITE VERSUS CONTINUOUS OPERATION
`--duration` and `--interval` accept fractional and composite durations, such as `--duration` and `--interval` accept fractional and composite durations, such as