]> granicus.if.org Git - pdns/commitdiff
split up auth latency stats between v4 and v6 since you need to be able to see them...
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 25 Sep 2015 21:30:30 +0000 (23:30 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 25 Sep 2015 21:30:30 +0000 (23:30 +0200)
docs/markdown/recursor/stats.md
pdns/rec_channel_rec.cc
pdns/syncres.cc
pdns/syncres.hh

index 0b4eb909d6442e82c73511a22baffae3c720cdd4..88182b2c2dec3ba51fe98187029193e51a87d101 100644 (file)
@@ -7,11 +7,16 @@ The `rec_control get` command can be used to query the following statistics, eit
 * `answers1-10`: counts the number of queries answered within 10 milliseconds
 * `answers10-100`: counts the number of queries answered within 100 milliseconds
 * `answers100-1000`: counts the number of queries answered within 1 second
-* `auth-answers-slow`: counts the number of queries answered by auths after 1 second (4.0)
-* `auth-answers0-1`: counts the number of queries answered by auths within 1 millisecond (4.0)
-* `auth-answers1-10`: counts the number of queries answered by auths within 10 milliseconds (4.0)
-* `auth-answers10-100`: counts the number of queries answered by auths within 100 milliseconds (4.0)
-* `auth-answers100-1000`: counts the number of queries answered by auths within 1 second (4.0)
+* `auth4-answers-slow`: counts the number of queries answered by auth4s after 1 second (4.0)
+* `auth4-answers0-1`: counts the number of queries answered by auth4s within 1 millisecond (4.0)
+* `auth4-answers1-10`: counts the number of queries answered by auth4s within 10 milliseconds (4.0)
+* `auth4-answers10-100`: counts the number of queries answered by auth4s within 100 milliseconds (4.0)
+* `auth4-answers100-1000`: counts the number of queries answered by auth4s within 1 second (4.0)
+* `auth6-answers-slow`: counts the number of queries answered by auth6s after 1 second (4.0)
+* `auth6-answers0-1`: counts the number of queries answered by auth6s within 1 millisecond (4.0)
+* `auth6-answers1-10`: counts the number of queries answered by auth6s within 10 milliseconds (4.0)
+* `auth6-answers10-100`: counts the number of queries answered by auth6s within 100 milliseconds (4.0)
+* `auth6-answers100-1000`: counts the number of queries answered by auth6s within 1 second (4.0)
 * `cache-bytes`: size of the cache in bytes (since 3.3.1)
 * `cache-entries`: shows the number of entries in the cache
 * `cache-hits`: counts the number of cache hits since starting, this does **not** include hits that got answered from the packet-cache
@@ -38,6 +43,8 @@ The `rec_control get` command can be used to query the following statistics, eit
 * `nsspeeds-entries`: shows the number of entries in the NS speeds map
 * `nxdomain-answers`: counts the number of times it answered NXDOMAIN since starting
 * `outgoing-timeouts`: counts the number of timeouts on outgoing UDP queries since starting
+* `outgoing4-timeouts`: counts the number of timeouts on outgoing UDP IPv4 queries since starting (since 4.0)
+* `outgoing6-timeouts`: counts the number of timeouts on outgoing UDP IPv6 queries since starting (since 4.0)
 * `over-capacity-drops`: questions dropped because over maximum concurrent query limit (since 3.2)
 * `packetcache-bytes`: size of the packet cache in bytes (since 3.3.1)
 * `packetcache-entries`: size of packet cache (since 3.2)
index 55ab3cfa05c272128ea8f5c00cfcf8d89a60eb0e..374840f00bfa8d6a120c8d96578262993609342d 100644 (file)
@@ -523,11 +523,18 @@ RecursorControlParser::RecursorControlParser()
   addGetStat("answers100-1000", &g_stats.answers100_1000);
   addGetStat("answers-slow", &g_stats.answersSlow);
 
-  addGetStat("auth-answers0-1", &g_stats.authAnswers0_1);
-  addGetStat("auth-answers1-10", &g_stats.authAnswers1_10);
-  addGetStat("auth-answers10-100", &g_stats.authAnswers10_100);
-  addGetStat("auth-answers100-1000", &g_stats.authAnswers100_1000);
-  addGetStat("auth-answers-slow", &g_stats.authAnswersSlow);
+  addGetStat("auth4-answers0-1", &g_stats.auth4Answers0_1);
+  addGetStat("auth4-answers1-10", &g_stats.auth4Answers1_10);
+  addGetStat("auth4-answers10-100", &g_stats.auth4Answers10_100);
+  addGetStat("auth4-answers100-1000", &g_stats.auth4Answers100_1000);
+  addGetStat("auth4-answers-slow", &g_stats.auth4AnswersSlow);
+
+  addGetStat("auth6-answers0-1", &g_stats.auth6Answers0_1);
+  addGetStat("auth6-answers1-10", &g_stats.auth6Answers1_10);
+  addGetStat("auth6-answers10-100", &g_stats.auth6Answers10_100);
+  addGetStat("auth6-answers100-1000", &g_stats.auth6Answers100_1000);
+  addGetStat("auth6-answers-slow", &g_stats.auth6AnswersSlow);
+
 
   addGetStat("qa-latency", doGetAvgLatencyUsec);
   addGetStat("unexpected-packets", &g_stats.unexpectedCount);
@@ -552,6 +559,8 @@ RecursorControlParser::RecursorControlParser()
   addGetStat("concurrent-queries", boost::bind(getConcurrentQueries)); 
   addGetStat("security-status", &g_security_status);
   addGetStat("outgoing-timeouts", &SyncRes::s_outgoingtimeouts);
+  addGetStat("outgoing4-timeouts", &SyncRes::s_outgoing4timeouts);
+  addGetStat("outgoing6-timeouts", &SyncRes::s_outgoing6timeouts);
   addGetStat("tcp-outqueries", &SyncRes::s_tcpoutqueries);
   addGetStat("all-outqueries", &SyncRes::s_outqueries);
   addGetStat("ipv6-outqueries", &g_stats.ipv6queries);
index 7f1c4a88dd676237c74ef09993a9fcf66c4284d6..d5d276295701fcf4dab8ac58f02ac26d796ea5bd 100644 (file)
@@ -57,6 +57,8 @@ unsigned int SyncRes::s_serverdownmaxfails;
 unsigned int SyncRes::s_serverdownthrottletime;
 uint64_t SyncRes::s_queries;
 uint64_t SyncRes::s_outgoingtimeouts;
+uint64_t SyncRes::s_outgoing4timeouts;
+uint64_t SyncRes::s_outgoing6timeouts;
 uint64_t SyncRes::s_outqueries;
 uint64_t SyncRes::s_tcpoutqueries;
 uint64_t SyncRes::s_throttledqueries;
@@ -77,18 +79,32 @@ SyncRes::LogMode SyncRes::s_lm;
 bool SyncRes::s_noEDNSPing;
 bool SyncRes::s_noEDNS;
 
-void accountAuthLatency(int usec)
+void accountAuthLatency(int usec, int family)
 {
-  if(usec < 1000)
-    g_stats.authAnswers0_1++;
-  else if(usec < 10000)
-    g_stats.authAnswers1_10++;
-  else if(usec < 100000)
-    g_stats.authAnswers10_100++;
-  else if(usec < 1000000)
-    g_stats.authAnswers100_1000++;
-  else
-    g_stats.authAnswersSlow++;
+  if(family == AF_INET) {
+    if(usec < 1000)
+      g_stats.auth4Answers0_1++;
+    else if(usec < 10000)
+      g_stats.auth4Answers1_10++;
+    else if(usec < 100000)
+      g_stats.auth4Answers10_100++;
+    else if(usec < 1000000)
+      g_stats.auth4Answers100_1000++;
+    else
+      g_stats.auth4AnswersSlow++;
+  } else  {
+    if(usec < 1000)
+      g_stats.auth6Answers0_1++;
+    else if(usec < 10000)
+      g_stats.auth6Answers1_10++;
+    else if(usec < 100000)
+      g_stats.auth6Answers10_100++;
+    else if(usec < 1000000)
+      g_stats.auth6Answers100_1000++;
+    else
+      g_stats.auth6AnswersSlow++;
+  }
+
 }
 
 SyncRes::SyncRes(const struct timeval& now) :  d_outqueries(0), d_tcpoutqueries(0), d_throttledqueries(0), d_timeouts(0), d_unreachables(0),
@@ -992,12 +1008,16 @@ int SyncRes::doResolveAt(set<DNSName> nameservers, DNSName auth, bool flawedNSSe
              throw ImmediateServFailException("Query killed by policy");
 
            d_totUsec += lwr.d_usec;
-           accountAuthLatency(lwr.d_usec);
+           accountAuthLatency(lwr.d_usec, remoteIP->sin4.sin_family);
            if(resolveret != 1) {
               if(resolveret==0) {
                 LOG(prefix<<qname.toString()<<": timeout resolving after "<<lwr.d_usec/1000.0<<"msec "<< (doTCP ? "over TCP" : "")<<endl);
                 d_timeouts++;
                 s_outgoingtimeouts++;
+               if(remoteIP->sin4.sin_family == AF_INET)
+                 s_outgoing4timeouts++;
+               else
+                 s_outgoing6timeouts++;
               }
               else if(resolveret==-2) {
                 LOG(prefix<<qname.toString()<<": hit a local resource limit resolving"<< (doTCP ? " over TCP" : "")<<", probable error: "<<stringerror()<<endl);
index b9147222c041a33703d5f5b2c6772c3df401b01a..838a35e92714913baae1b1ee181dd2fa3ce0aac1 100644 (file)
@@ -291,6 +291,8 @@ public:
 
   static uint64_t s_queries;
   static uint64_t s_outgoingtimeouts;
+  static uint64_t s_outgoing4timeouts;
+  static uint64_t s_outgoing6timeouts;
   static uint64_t s_throttledqueries;
   static uint64_t s_dontqueries;
   static uint64_t s_outqueries;
@@ -545,7 +547,8 @@ struct RecursorStats
   uint64_t nxDomains;
   uint64_t noErrors;
   uint64_t answers0_1, answers1_10, answers10_100, answers100_1000, answersSlow;
-  uint64_t authAnswers0_1, authAnswers1_10, authAnswers10_100, authAnswers100_1000, authAnswersSlow;
+  uint64_t auth4Answers0_1, auth4Answers1_10, auth4Answers10_100, auth4Answers100_1000, auth4AnswersSlow;
+  uint64_t auth6Answers0_1, auth6Answers1_10, auth6Answers10_100, auth6Answers100_1000, auth6AnswersSlow;
   double avgLatencyUsec;
   uint64_t qcounter;     // not increased for unauth packets
   uint64_t ipv6qcounter;