From: Remi Gacogne Date: Fri, 11 May 2018 14:34:11 +0000 (+0200) Subject: calidns: Add a --quiet option X-Git-Tag: dnsdist-1.3.1~104^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6601%2Fhead;p=thirdparty%2Fpdns.git calidns: Add a --quiet option --- diff --git a/docs/manpages/calidns.1.rst b/docs/manpages/calidns.1.rst index 96ee6fa394..8ec977b8c8 100644 --- a/docs/manpages/calidns.1.rst +++ b/docs/manpages/calidns.1.rst @@ -43,4 +43,6 @@ Options --minimum-success-rate Stop the test as soon as the success rate drops below this value, in percent. --plot-file Write results to the specified file. +--quiet Whether to run quietly, outputting only the maximum QPS reached. + This option is mostly useful when used with --minimum-success-rate. --want-recursion Set this flag to send queries with the Recursion Desired flag set. diff --git a/pdns/calidns.cc b/pdns/calidns.cc index 90dbfa90cf..503e932de9 100644 --- a/pdns/calidns.cc +++ b/pdns/calidns.cc @@ -227,6 +227,7 @@ try ("maximum-qps", po::value(), "Stop incrementing once this rate has been reached, to provide a stable load") ("minimum-success-rate", po::value()->default_value(0), "Stop the test as soon as the success rate drops below this value, in percent") ("plot-file", po::value(), "Write results to the specific file") + ("quiet", "Whether to run quietly, outputting only the maximum QPS reached. This option is mostly useful when used with --minimum-success-rate") ("want-recursion", "Set the Recursion Desired flag on queries"); po::options_description alloptions; po::options_description hidden("hidden options"); @@ -269,6 +270,7 @@ try } bool wantRecursion = g_vm.count("want-recursion"); + bool beQuiet = g_vm.count("quiet"); bool useECSFromFile = g_vm.count("ecs-from-file"); double hitrate = g_vm["hitrate"].as(); @@ -303,7 +305,9 @@ try return EXIT_FAILURE; } - cout<<"Adding ECS option to outgoing queries with random addresses from the "<>(packet)); } random_shuffle(unknown.begin(), unknown.end()); - cout<<"Generated "< sockets; ComboAddress dest; @@ -401,13 +407,17 @@ try for(qps=qpsstart;;) { double seconds=1; - cout<<"Aiming at "< unknown.size()) { cerr<<"Not enough queries remaining (need at least "< 0.0 && perc < minimumSuccessRate) { - cout<<"The latest success rate ("<