From 406f46f9aa861118b124652680febc164e53c33c Mon Sep 17 00:00:00 2001 From: bert hubert Date: Thu, 3 Apr 2014 11:28:55 +0200 Subject: [PATCH] new metric, failed-host-entries --- pdns/rec_channel_rec.cc | 11 +++++++++++ pdns/syncres.hh | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) 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; -- 2.47.2