From: bert hubert Date: Thu, 11 Jul 2013 15:05:24 +0000 (+0200) Subject: teach dnsscope some more statistics, like non-rd X-Git-Tag: rec-3.6.0-rc1~575 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54067f8c0d57ea70bbd25fc7e51b60e69cbeb1d4;p=thirdparty%2Fpdns.git teach dnsscope some more statistics, like non-rd --- diff --git a/pdns/dnsscope.cc b/pdns/dnsscope.cc index 218fd36dd9..a687462de8 100644 --- a/pdns/dnsscope.cc +++ b/pdns/dnsscope.cc @@ -48,7 +48,7 @@ try int dnserrors=0, bogus=0; typedef map cumul_t; cumul_t cumul; - unsigned int untracked=0, errorresult=0, reallylate=0; + unsigned int untracked=0, errorresult=0, reallylate=0, nonRDQueries=0, queries=0; typedef map rcodes_t; rcodes_t rcodes; @@ -62,6 +62,11 @@ try pr.d_len > 12) { try { MOADNSParser mdp((const char*)pr.d_payload, pr.d_len); + if(!mdp.d_header.qr) { + if(!mdp.d_header.rd) + nonRDQueries++; + queries++; + } lowestTime=min((time_t)lowestTime, (time_t)pr.d_pheader.ts.tv_sec); highestTime=max((time_t)highestTime, (time_t)pr.d_pheader.ts.tv_sec); @@ -135,6 +140,7 @@ try } } + cerr<< boost::format("%d (%.02f%% of all) queries did not request recursion") % nonRDQueries % ((nonRDQueries*100.0)/queries) << endl; cerr<