From: Remi Gacogne Date: Wed, 2 Dec 2015 16:19:19 +0000 (+0100) Subject: Add stats for RD queries in dnsdist X-Git-Tag: dnsdist-1.0.0-alpha1~144^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=643a182a6e1102aff010b443411966cf76e949b8;p=pdns Add stats for RD queries in dnsdist --- diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index 739ad5200..aafbfce97 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -172,6 +172,10 @@ void* tcpClientThread(int pipefd) goto drop; } + if (dh->rd) { + g_stats.rdQueries++; + } + if(blockFilter) { std::lock_guard lock(g_luamutex); diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 3c05ffdad..999069b3d 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -454,6 +454,10 @@ try g_stats.nonCompliantQueries++; continue; } + + if (dh->rd) { + g_stats.rdQueries++; + } const uint16_t * flags = getFlagsFromDNSHeader(dh); const uint16_t origFlags = *flags; diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 7d358fbae..19996a418 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -21,6 +21,7 @@ struct DNSDistStats stat_t servfailResponses{0}; stat_t queries{0}; stat_t nonCompliantQueries{0}; + stat_t rdQueries{0}; stat_t aclDrops{0}; stat_t blockFilter{0}; stat_t dynBlocked{0}; @@ -51,6 +52,7 @@ struct DNSDistStats {"uptime", uptimeOfProcess}, {"real-memory-usage", getRealMemoryUsage}, {"noncompliant-queries", &nonCompliantQueries}, + {"rdqueries", &rdQueries}, {"cpu-user-msec", getCPUTimeUser}, {"cpu-sys-msec", getCPUTimeSystem}, {"fd-usage", getOpenFileDescriptors}, {"dyn-blocked", &dynBlocked},