From: bert hubert Date: Thu, 3 Apr 2014 09:28:55 +0000 (+0200) Subject: new metric, failed-host-entries X-Git-Tag: rec-3.6.0-rc1~93 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=406f46f9aa861118b124652680febc164e53c33c;p=thirdparty%2Fpdns.git new metric, failed-host-entries --- diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 4c8c680eb5..1378addb56 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -313,6 +313,16 @@ uint64_t getNegCacheSize() return broadcastAccFunction(pleaseGetNegCacheSize); } +uint64_t* pleaseGetFailedHostsSize() +{ + uint64_t tmp=t_sstorage->fails.size(); + return new uint64_t(tmp); +} +uint64_t getFailedHostsSize() +{ + return broadcastAccFunction(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); diff --git a/pdns/syncres.hh b/pdns/syncres.hh index eb48af17da..c15489f987 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -220,7 +220,10 @@ public: d_cont.erase(i); } } - + size_t size() + { + return d_cont.size(); + } private: typedef map cont_t; cont_t d_cont;