]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add XFR queue statistic 9239/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 17 Jun 2020 07:49:54 +0000 (09:49 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 17 Jun 2020 11:39:10 +0000 (13:39 +0200)
pdns/common_startup.cc
pdns/communicator.hh
pdns/slavecommunicator.cc
regression-tests.nobackend/counters/expected_result

index fe4994cc1392e12ad86babd5a76d95682f7e0ba1..d476a6f2e77b3dbf053331fed1c05d3d9bff47b8 100644 (file)
@@ -371,6 +371,7 @@ void declareStats(void)
   S.declare("latency","Average number of microseconds needed to answer a question", getLatency, StatType::gauge);
   S.declare("timedout-packets","Number of packets which weren't answered within timeout set");
   S.declare("security-status", "Security status based on regular polling", StatType::gauge);
+  S.declare("xfr-queue", "Size of the queue of domains to be XFRd", [](const string&) { return Communicator.getSuckRequestsWaiting(); }, StatType::gauge);
   S.declareDNSNameQTypeRing("queries","UDP Queries Received");
   S.declareDNSNameQTypeRing("nxdomain-queries","Queries for non-existent records within existent domains");
   S.declareDNSNameQTypeRing("noerror-queries","Queries for existing records, but for type we don't have");
index 9d718ba1f5f89af514c7dda237e232e74c97a45c..366ec98727318f2614bafb553534f895a1abde10 100644 (file)
@@ -170,6 +170,7 @@ public:
   void sendNotification(int sock, const DNSName &domain, const ComboAddress& remote, uint16_t id, UeberBackend* B);
   bool notifyDomain(const DNSName &domain, UeberBackend* B);
   vector<pair<DNSName, ComboAddress> > getSuckRequests();
+  size_t getSuckRequestsWaiting();
 private:
   void loadArgsIntoSet(const char *listname, set<string> &listset);
   void makeNotifySockets();
index d46020e1472aaf2948716153b839b8cdd6b04320..1782bb99b187508e651e69730ab7d061a9ac9a14 100644 (file)
@@ -1013,3 +1013,8 @@ vector<pair<DNSName, ComboAddress> > CommunicatorClass::getSuckRequests() {
   }
   return ret;
 }
+
+size_t CommunicatorClass::getSuckRequestsWaiting() {
+  std::lock_guard<std::mutex> l(d_lock);
+  return d_suckdomains.size();
+}
index 917a0bc9293df287defa39d215a65ff149536bd0..ce6b57c5c4552cf5e646ceebdc589e4b72e60fb3 100644 (file)
@@ -62,3 +62,4 @@ udp4-queries=2
 udp6-answers-bytes=132
 udp6-answers=2
 udp6-queries=2
+xfr-queue=0