From: Otto Moerbeek Date: Tue, 12 Nov 2019 15:42:10 +0000 (+0100) Subject: Also purge t_sstorage.ednsstatus and include edns size in the periodic report. X-Git-Tag: dnsdist-1.4.0^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbc7101c05672d91f5131fa5baa884a750e139a4;p=thirdparty%2Fpdns.git Also purge t_sstorage.ednsstatus and include edns size in the periodic report. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 0562ccb919..2c33ce9213 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -2845,7 +2845,8 @@ static void doStats(void) g_log<(pleaseGetThrottleSize) <<", ns speeds: " << broadcastAccFunction(pleaseGetNsSpeedsSize)<<", failed ns: " - << broadcastAccFunction(pleaseGetFailedServersSize)<(pleaseGetFailedServersSize)<<", ednsmap: " + <(pleaseGetEDNSStatusesSize)<numProcesses() : 0); diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 00220c9a70..c400434421 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -513,6 +513,16 @@ public: { t_sstorage.ednsstatus.clear(); } + static void pruneEDNSStatuses(time_t cutoff) + { + for (auto it = t_sstorage.ednsstatus.begin(); it != t_sstorage.ednsstatus.end(); ) { + if (it->second.modeSetAt && it->second.modeSetAt <= cutoff) { + it = t_sstorage.ednsstatus.erase(it); + } else { + ++it; + } + } + } static uint64_t getThrottledServersSize() { return t_sstorage.throttle.size(); @@ -1083,6 +1093,7 @@ template T broadcastAccFunction(const boost::function& func); std::shared_ptr parseAuthAndForwards(); uint64_t* pleaseGetNsSpeedsSize(); uint64_t* pleaseGetFailedServersSize(); +uint64_t* pleaseGetEDNSStatusesSize(); uint64_t* pleaseGetCacheSize(); uint64_t* pleaseGetNegCacheSize(); uint64_t* pleaseGetCacheHits();