From: bert hubert Date: Fri, 25 Sep 2015 21:30:30 +0000 (+0200) Subject: split up auth latency stats between v4 and v6 since you need to be able to see them... X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b75810edbc4b09ea1f3b7fbceb6b285999ad743;p=thirdparty%2Fpdns.git split up auth latency stats between v4 and v6 since you need to be able to see them separately. Also add 4 and 6 versions of timeouts. --- diff --git a/docs/markdown/recursor/stats.md b/docs/markdown/recursor/stats.md index 0b4eb909d6..88182b2c2d 100644 --- a/docs/markdown/recursor/stats.md +++ b/docs/markdown/recursor/stats.md @@ -7,11 +7,16 @@ The `rec_control get` command can be used to query the following statistics, eit * `answers1-10`: counts the number of queries answered within 10 milliseconds * `answers10-100`: counts the number of queries answered within 100 milliseconds * `answers100-1000`: counts the number of queries answered within 1 second -* `auth-answers-slow`: counts the number of queries answered by auths after 1 second (4.0) -* `auth-answers0-1`: counts the number of queries answered by auths within 1 millisecond (4.0) -* `auth-answers1-10`: counts the number of queries answered by auths within 10 milliseconds (4.0) -* `auth-answers10-100`: counts the number of queries answered by auths within 100 milliseconds (4.0) -* `auth-answers100-1000`: counts the number of queries answered by auths within 1 second (4.0) +* `auth4-answers-slow`: counts the number of queries answered by auth4s after 1 second (4.0) +* `auth4-answers0-1`: counts the number of queries answered by auth4s within 1 millisecond (4.0) +* `auth4-answers1-10`: counts the number of queries answered by auth4s within 10 milliseconds (4.0) +* `auth4-answers10-100`: counts the number of queries answered by auth4s within 100 milliseconds (4.0) +* `auth4-answers100-1000`: counts the number of queries answered by auth4s within 1 second (4.0) +* `auth6-answers-slow`: counts the number of queries answered by auth6s after 1 second (4.0) +* `auth6-answers0-1`: counts the number of queries answered by auth6s within 1 millisecond (4.0) +* `auth6-answers1-10`: counts the number of queries answered by auth6s within 10 milliseconds (4.0) +* `auth6-answers10-100`: counts the number of queries answered by auth6s within 100 milliseconds (4.0) +* `auth6-answers100-1000`: counts the number of queries answered by auth6s within 1 second (4.0) * `cache-bytes`: size of the cache in bytes (since 3.3.1) * `cache-entries`: shows the number of entries in the cache * `cache-hits`: counts the number of cache hits since starting, this does **not** include hits that got answered from the packet-cache @@ -38,6 +43,8 @@ The `rec_control get` command can be used to query the following statistics, eit * `nsspeeds-entries`: shows the number of entries in the NS speeds map * `nxdomain-answers`: counts the number of times it answered NXDOMAIN since starting * `outgoing-timeouts`: counts the number of timeouts on outgoing UDP queries since starting +* `outgoing4-timeouts`: counts the number of timeouts on outgoing UDP IPv4 queries since starting (since 4.0) +* `outgoing6-timeouts`: counts the number of timeouts on outgoing UDP IPv6 queries since starting (since 4.0) * `over-capacity-drops`: questions dropped because over maximum concurrent query limit (since 3.2) * `packetcache-bytes`: size of the packet cache in bytes (since 3.3.1) * `packetcache-entries`: size of packet cache (since 3.2) diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 55ab3cfa05..374840f00b 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -523,11 +523,18 @@ RecursorControlParser::RecursorControlParser() addGetStat("answers100-1000", &g_stats.answers100_1000); addGetStat("answers-slow", &g_stats.answersSlow); - addGetStat("auth-answers0-1", &g_stats.authAnswers0_1); - addGetStat("auth-answers1-10", &g_stats.authAnswers1_10); - addGetStat("auth-answers10-100", &g_stats.authAnswers10_100); - addGetStat("auth-answers100-1000", &g_stats.authAnswers100_1000); - addGetStat("auth-answers-slow", &g_stats.authAnswersSlow); + addGetStat("auth4-answers0-1", &g_stats.auth4Answers0_1); + addGetStat("auth4-answers1-10", &g_stats.auth4Answers1_10); + addGetStat("auth4-answers10-100", &g_stats.auth4Answers10_100); + addGetStat("auth4-answers100-1000", &g_stats.auth4Answers100_1000); + addGetStat("auth4-answers-slow", &g_stats.auth4AnswersSlow); + + addGetStat("auth6-answers0-1", &g_stats.auth6Answers0_1); + addGetStat("auth6-answers1-10", &g_stats.auth6Answers1_10); + addGetStat("auth6-answers10-100", &g_stats.auth6Answers10_100); + addGetStat("auth6-answers100-1000", &g_stats.auth6Answers100_1000); + addGetStat("auth6-answers-slow", &g_stats.auth6AnswersSlow); + addGetStat("qa-latency", doGetAvgLatencyUsec); addGetStat("unexpected-packets", &g_stats.unexpectedCount); @@ -552,6 +559,8 @@ RecursorControlParser::RecursorControlParser() addGetStat("concurrent-queries", boost::bind(getConcurrentQueries)); addGetStat("security-status", &g_security_status); addGetStat("outgoing-timeouts", &SyncRes::s_outgoingtimeouts); + addGetStat("outgoing4-timeouts", &SyncRes::s_outgoing4timeouts); + addGetStat("outgoing6-timeouts", &SyncRes::s_outgoing6timeouts); addGetStat("tcp-outqueries", &SyncRes::s_tcpoutqueries); addGetStat("all-outqueries", &SyncRes::s_outqueries); addGetStat("ipv6-outqueries", &g_stats.ipv6queries); diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 7f1c4a88dd..d5d2762957 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -57,6 +57,8 @@ unsigned int SyncRes::s_serverdownmaxfails; unsigned int SyncRes::s_serverdownthrottletime; uint64_t SyncRes::s_queries; uint64_t SyncRes::s_outgoingtimeouts; +uint64_t SyncRes::s_outgoing4timeouts; +uint64_t SyncRes::s_outgoing6timeouts; uint64_t SyncRes::s_outqueries; uint64_t SyncRes::s_tcpoutqueries; uint64_t SyncRes::s_throttledqueries; @@ -77,18 +79,32 @@ SyncRes::LogMode SyncRes::s_lm; bool SyncRes::s_noEDNSPing; bool SyncRes::s_noEDNS; -void accountAuthLatency(int usec) +void accountAuthLatency(int usec, int family) { - if(usec < 1000) - g_stats.authAnswers0_1++; - else if(usec < 10000) - g_stats.authAnswers1_10++; - else if(usec < 100000) - g_stats.authAnswers10_100++; - else if(usec < 1000000) - g_stats.authAnswers100_1000++; - else - g_stats.authAnswersSlow++; + if(family == AF_INET) { + if(usec < 1000) + g_stats.auth4Answers0_1++; + else if(usec < 10000) + g_stats.auth4Answers1_10++; + else if(usec < 100000) + g_stats.auth4Answers10_100++; + else if(usec < 1000000) + g_stats.auth4Answers100_1000++; + else + g_stats.auth4AnswersSlow++; + } else { + if(usec < 1000) + g_stats.auth6Answers0_1++; + else if(usec < 10000) + g_stats.auth6Answers1_10++; + else if(usec < 100000) + g_stats.auth6Answers10_100++; + else if(usec < 1000000) + g_stats.auth6Answers100_1000++; + else + g_stats.auth6AnswersSlow++; + } + } SyncRes::SyncRes(const struct timeval& now) : d_outqueries(0), d_tcpoutqueries(0), d_throttledqueries(0), d_timeouts(0), d_unreachables(0), @@ -992,12 +1008,16 @@ int SyncRes::doResolveAt(set nameservers, DNSName auth, bool flawedNSSe throw ImmediateServFailException("Query killed by policy"); d_totUsec += lwr.d_usec; - accountAuthLatency(lwr.d_usec); + accountAuthLatency(lwr.d_usec, remoteIP->sin4.sin_family); if(resolveret != 1) { if(resolveret==0) { LOG(prefix<sin4.sin_family == AF_INET) + s_outgoing4timeouts++; + else + s_outgoing6timeouts++; } else if(resolveret==-2) { LOG(prefix<