]> granicus.if.org Git - pdns/commitdiff
improve statistics for the recursor, split out timeout and real errors, report on...
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 21 Jun 2005 18:34:17 +0000 (18:34 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 21 Jun 2005 18:34:17 +0000 (18:34 +0000)
clarify non-existent statistics w/o queries

git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@414 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/lwres.cc
pdns/pdns_recursor.cc
pdns/syncres.cc
pdns/syncres.hh

index b01cc8eb9675fa50a39db3d2188661741ac70c31..a50415cb2e0ca997403a1de6802283b5cda79c09 100644 (file)
@@ -75,7 +75,6 @@ int LWRes::asyncresolve(const string &ip, const char *domain, int type)
   toaddr.sin_port=htons(53);
   toaddr.sin_family=AF_INET;
 
-
   int ret;
 
   DTime dt;
index ecfedb020c894ee653ac8f8aa344dad015c745d2..500374f481323b503ebc55ead1db7664f2c4ac55 100644 (file)
@@ -1,6 +1,6 @@
 /*
     PowerDNS Versatile Database Driven Nameserver
-    Copyright (C) 2005  PowerDNS.COM BV
+    Copyright (C) 2003 - 2005  PowerDNS.COM BV
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License version 2 
@@ -359,8 +359,11 @@ void doStats(void)
     L<<Logger::Error<<", outpacket/query ratio "<<(int)(SyncRes::s_outqueries*100.0/SyncRes::s_queries)<<"%";
     L<<Logger::Error<<", "<<(int)(SyncRes::s_throttledqueries*100.0/(SyncRes::s_outqueries+SyncRes::s_throttledqueries))<<"% throttled, "
      <<SyncRes::s_nodelegated<<" no-delegation drops"<<endl;
-    L<<Logger::Error<<"queries running: "<<MT->numProcesses()<<endl;
+    L<<Logger::Error<<"stats: "<<MT->numProcesses()<<" queries running, "<<SyncRes::s_outgoingtimeouts<<" outgoing timeouts"<<endl;
   }
+  else if(statsWanted) 
+    L<<Logger::Error<<"stats: no stats yet!"<<endl;
+
   statsWanted=false;
 }
 
index 20e900eba4ce15d80a65e8d38d29684d2ffa6663..769beaedcd7ac20c12fc8d4919ebc81a8e66eaa3 100644 (file)
@@ -37,6 +37,7 @@ extern MemRecursorCache RC;
 
 map<string,NegCacheEntry> SyncRes::s_negcache;    
 unsigned int SyncRes::s_queries;
+unsigned int SyncRes::s_outgoingtimeouts;
 unsigned int SyncRes::s_outqueries;
 unsigned int SyncRes::s_throttledqueries;
 unsigned int SyncRes::s_nodelegated;
@@ -385,10 +386,18 @@ int SyncRes::doResolveAt(set<string> nameservers, string auth, const string &qna
       else {
        s_outqueries++;
        d_outqueries++;
-       if(d_lwr.asyncresolve(remoteIP,qname.c_str(),qtype.getCode())!=1) { // <- we go out on the wire!
-         LOG<<prefix<<qname<<": error resolving (perhaps timeout?)"<<endl;
+       int ret=d_lwr.asyncresolve(remoteIP,qname.c_str(),qtype.getCode());
+       if(ret != 1) { // <- we go out on the wire!
+         if(ret==0) {
+           LOG<<prefix<<qname<<": timeout resolving"<<endl;
+           d_timeouts++;
+           s_outgoingtimeouts++;
+         }
+         else
+           LOG<<prefix<<qname<<": error resolving"<<endl;
+
          nsSpeeds[toLower(*tns)].submit(1000000); // 1 sec
-         d_timeouts++;
+         
          s_throttle.throttle(d_now, remoteIP+"|"+qname+"|"+qtype.getName(),20,5);
          continue;
        }
index ae89f77eee945c1c85ceef83eed6e026be79c16f..750951272b15fe7f8e137143e8d0943c7c3c6b95 100644 (file)
@@ -135,6 +135,7 @@ public:
     d_nocache=state;
   }
   static unsigned int s_queries;
+  static unsigned int s_outgoingtimeouts;
   static unsigned int s_throttledqueries;
   static unsigned int s_outqueries;
   static unsigned int s_nodelegated;