]> granicus.if.org Git - pdns/commitdiff
add some ECS metrics (UNDOCUMENTED)
authorbert hubert <bert.hubert@powerdns.com>
Thu, 15 Jun 2017 01:15:40 +0000 (03:15 +0200)
committerbert hubert <bert.hubert@powerdns.com>
Thu, 29 Jun 2017 10:29:37 +0000 (12:29 +0200)
pdns/rec_channel_rec.cc
pdns/syncres.cc
pdns/syncres.hh

index 6dccf5477288aa24df56a995fd107deab6e9d376..2d086f1ed426a405248d600698df118106a60688 100644 (file)
@@ -860,6 +860,8 @@ void registerAllStats()
   addGetStat("dont-outqueries", &SyncRes::s_dontqueries);
   addGetStat("throttled-out", &SyncRes::s_throttledqueries);
   addGetStat("unreachables", &SyncRes::s_unreachables);
+  addGetStat("ecs-queries", &SyncRes::s_ecsqueries);
+  addGetStat("ecs-responses", &SyncRes::s_ecsresponses);
   addGetStat("chain-resends", &g_stats.chainResends);
   addGetStat("tcp-clients", boost::bind(TCPConnection::getCurrentConnections));
 
index bd1ee3930526edff0d967a70a17281776726bc93..8fa0f957694384b95c659f59eea6ff673be54a28 100644 (file)
@@ -64,6 +64,8 @@ std::atomic<uint64_t> SyncRes::s_throttledqueries;
 std::atomic<uint64_t> SyncRes::s_dontqueries;
 std::atomic<uint64_t> SyncRes::s_nodelegated;
 std::atomic<uint64_t> SyncRes::s_unreachables;
+std::atomic<uint64_t> SyncRes::s_ecsqueries;
+std::atomic<uint64_t> SyncRes::s_ecsresponses;
 uint8_t SyncRes::s_ecsipv4limit;
 uint8_t SyncRes::s_ecsipv6limit;
 bool SyncRes::s_doIPv6;
@@ -2008,10 +2010,12 @@ bool SyncRes::doResolveAtThisIP(const std::string& prefix, const DNSName& qname,
     ednsmask=getEDNSSubnetMask(d_requestor, qname, remoteIP);
     if(ednsmask) {
       LOG(prefix<<qname<<": Adding EDNS Client Subnet Mask "<<ednsmask->toString()<<" to query"<<endl);
+      s_ecsqueries++;
     }
     resolveret = asyncresolveWrapper(remoteIP, d_doDNSSEC, qname,  qtype.getCode(),
                                      doTCP, sendRDQuery, &d_now, ednsmask, &lwr);    // <- we go out on the wire!
     if(ednsmask) {
+      s_ecsresponses++;
       LOG(prefix<<qname<<": Received EDNS Client Subnet Mask "<<ednsmask->toString()<<" on response"<<endl);
     }
   }
index 71efffda4546f3798da3e251c7cc4be400d4c074..e6a4e8d1499c944bfa0d2ab6ef54a045dfcd868d 100644 (file)
@@ -655,6 +655,8 @@ public:
   static std::atomic<uint64_t> s_tcpoutqueries;
   static std::atomic<uint64_t> s_nodelegated;
   static std::atomic<uint64_t> s_unreachables;
+  static std::atomic<uint64_t> s_ecsqueries;
+  static std::atomic<uint64_t> s_ecsresponses;
 
   static string s_serverID;
   static unsigned int s_minimumTTL;