From: Bert Hubert Date: Thu, 10 Jan 2013 15:26:43 +0000 (+0000) Subject: implement AND DOCUMENT (wow!) ipv6-questions metric - patch including docs (WOW!... X-Git-Tag: auth-3.2~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7f1054145c537be36e99385c31de63ee3db8994;p=thirdparty%2Fpdns.git implement AND DOCUMENT (wow!) ipv6-questions metric - patch including docs (WOW!) from ticket 619, thanks Winfried! git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3034 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/docs/pdns.xml b/pdns/docs/pdns.xml index 1a4a863cf6..29c56d4415 100644 --- a/pdns/docs/pdns.xml +++ b/pdns/docs/pdns.xml @@ -13209,6 +13209,7 @@ packetcache-hits Packet cache hits (since 3.2) packetcache-misses Packet cache misses (since 3.2) qa-latency shows the current latency average, in microseconds questions counts all End-user initiated queries with the RD bit set +ipv6-questions counts all End-user initiated queries with the RD bit set, received over IPv6 UDP resource-limits counts number of queries that could not be performed because of resource limits server-parse-errors counts number of server replied packets that could not be parsed servfail-answers counts the number of times it answered SERVFAIL since starting diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 3a6511cbf6..2e465c8316 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -816,6 +816,8 @@ void handleNewTCPQuestion(int fd, FDMultiplexer::funcparam_t& ) string* doProcessUDPQuestion(const std::string& question, const ComboAddress& fromaddr, int fd) { ++g_stats.qcounter; + if(fromaddr.sin4.sin_family==AF_INET6) + g_stats.ipv6qcounter++; string response; try { diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 60aecc5277..7d969d3bac 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -402,6 +402,7 @@ uint64_t doGetMallocated() RecursorControlParser::RecursorControlParser() { addGetStat("questions", &g_stats.qcounter); + addGetStat("ipv6-questions", &g_stats.ipv6qcounter); addGetStat("tcp-questions", &g_stats.tcpqcounter); addGetStat("cache-hits", doGetCacheHits); diff --git a/pdns/syncres.hh b/pdns/syncres.hh index b3ab70567b..41ab66f1b4 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -460,6 +460,7 @@ struct RecursorStats uint64_t answers0_1, answers1_10, answers10_100, answers100_1000, answersSlow; uint64_t avgLatencyUsec; uint64_t qcounter; + uint64_t ipv6qcounter; uint64_t tcpqcounter; uint64_t unauthorizedUDP; uint64_t unauthorizedTCP;