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."