From c65ca20a494b52c660d8d2413e7af5c7faf6532c Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 28 Apr 2018 00:28:02 +0900 Subject: [PATCH] h2load: -r and --duration are mutually exclusive --- src/h2load.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/h2load.cc b/src/h2load.cc index 8dee4ffb..5916f200 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -1856,7 +1856,7 @@ Options: connections per period. When the rate is 0, the program will run as it normally does, creating connections at whatever variable rate it wants. The default value for - this option is 0. + this option is 0. -r and -D are mutually exclusive. --rate-period= Specifies the time period between creating connections. The period must be a positive number, representing the @@ -1865,7 +1865,8 @@ Options: option is 1s. -D, --duration= Specifies the main duration for the measurements in case - of timing-based benchmarking. + of timing-based benchmarking. -D and -r are mutually + exclusive. --warm-up-time= Specifies the time period before starting the actual measurements, in case of timing-based benchmarking. @@ -2298,6 +2299,11 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } + if (config.is_timing_based_mode() && config.is_rate_mode()) { + std::cerr << "-r, -D: they are mutually exclusive." << std::endl; + exit(EXIT_FAILURE); + } + if (config.nreqs == 0 && !config.is_timing_based_mode()) { std::cerr << "-n: the number of requests must be strictly greater than 0 " "if timing-based test is not being run."