]> granicus.if.org Git - pdns/commitdiff
Add stats for RD queries in dnsdist
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 2 Dec 2015 16:19:19 +0000 (17:19 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 2 Dec 2015 16:19:19 +0000 (17:19 +0100)
pdns/dnsdist-tcp.cc
pdns/dnsdist.cc
pdns/dnsdist.hh

index 739ad5200cbae08939e694990d7b0258cf9e38d4..aafbfce979bb943bc8d35ec49c2dc3e88c6c8f1a 100644 (file)
@@ -172,6 +172,10 @@ void* tcpClientThread(int pipefd)
          goto drop;
        }
 
+        if (dh->rd) {
+          g_stats.rdQueries++;
+        }
+
         if(blockFilter) {
          std::lock_guard<std::mutex> lock(g_luamutex);
        
index 3c05ffdad83e72dfcb41215ead519e3953d6f576..999069b3dce0f654de793412d427d59dc503651e 100644 (file)
@@ -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;
index 7d358fbaeccb4efe300cd5c6d3e6bff1f17cec86..19996a4186947f9474eee22e35776ab20a2750d5 100644 (file)
@@ -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},