]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
new metric, failed-host-entries
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 3 Apr 2014 09:28:55 +0000 (11:28 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 3 Apr 2014 09:28:55 +0000 (11:28 +0200)
pdns/rec_channel_rec.cc
pdns/syncres.hh

index 4c8c680eb5f287db03088125b6ba54245c978a8b..1378addb56f7ccf92309c85ca256203c47766790 100644 (file)
@@ -313,6 +313,16 @@ uint64_t getNegCacheSize()
   return broadcastAccFunction<uint64_t>(pleaseGetNegCacheSize);
 }
 
+uint64_t* pleaseGetFailedHostsSize()
+{
+  uint64_t tmp=t_sstorage->fails.size();
+  return new uint64_t(tmp);
+}
+uint64_t getFailedHostsSize()
+{
+  return broadcastAccFunction<uint64_t>(pleaseGetFailedHostsSize);
+}
+
 uint64_t* pleaseGetNsSpeedsSize()
 {
   return new uint64_t(t_sstorage->nsSpeeds.size());
@@ -484,6 +494,7 @@ RecursorControlParser::RecursorControlParser()
   addGetStat("throttle-entries", boost::bind(getThrottleSize)); 
 
   addGetStat("nsspeeds-entries", boost::bind(getNsSpeedsSize));
+  addGetStat("failed-host-entries", boost::bind(getFailedHostsSize));
 
   addGetStat("concurrent-queries", boost::bind(getConcurrentQueries)); 
   addGetStat("outgoing-timeouts", &SyncRes::s_outgoingtimeouts);
index eb48af17da76824e7003884b4d338c562c9245f0..c15489f9873da6f37fcc84f5f360eeb289c42f2c 100644 (file)
@@ -220,7 +220,10 @@ public:
       d_cont.erase(i);
     }
   }
-
+  size_t size()
+  {
+    return d_cont.size();
+  }
 private:
   typedef map<Thing,unsigned long> cont_t;
   cont_t d_cont;