]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Patch for server.num.zero_ttl stats for count of expired replies,
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 28 Oct 2016 15:08:32 +0000 (15:08 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 28 Oct 2016 15:08:32 +0000 (15:08 +0000)
  from Pavel Odintsov.

git-svn-id: file:///svn/unbound/trunk@3910 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/remote.c
daemon/stats.c
daemon/stats.h
daemon/worker.c
doc/Changelog
doc/unbound-control.8.in

index 692479bb7c49852c88105a380211e11474d7f7f5..2058caeb4d9bb1154c5359899e3604e90cc12ed6 100644 (file)
@@ -760,6 +760,8 @@ print_stats(SSL* ssl, const char* nm, struct stats_info* s)
                (unsigned long)s->svr.num_queries_missed_cache)) return 0;
        if(!ssl_printf(ssl, "%s.num.prefetch"SQ"%lu\n", nm, 
                (unsigned long)s->svr.num_queries_prefetch)) return 0;
+       if(!ssl_printf(ssl, "%s.num.zero_ttl"SQ"%lu\n", nm,
+               (unsigned long)s->svr.zero_ttl_responses)) return 0;
        if(!ssl_printf(ssl, "%s.num.recursivereplies"SQ"%lu\n", nm, 
                (unsigned long)s->mesh_replies_sent)) return 0;
        if(!ssl_printf(ssl, "%s.requestlist.avg"SQ"%g\n", nm,
index 838cf05ae52c699ebf241c8d33be843eb5f12b20..0687c0d24b43f37be448ae1098bca5cbca3f52b3 100644 (file)
@@ -251,6 +251,7 @@ void server_stats_add(struct stats_info* total, struct stats_info* a)
                total->svr.qEDNS += a->svr.qEDNS;
                total->svr.qEDNS_DO += a->svr.qEDNS_DO;
                total->svr.ans_rcode_nodata += a->svr.ans_rcode_nodata;
+               total->svr.zero_ttl_responses += a->svr.zero_ttl_responses;
                total->svr.ans_secure += a->svr.ans_secure;
                total->svr.ans_bogus += a->svr.ans_bogus;
                total->svr.rrset_bogus += a->svr.rrset_bogus;
index 6985446ce299a26ec1eadbbde63bf3148b43d5b7..6c4178fc5317dfd40b9f844f9eb3b8078a83f7c6 100644 (file)
@@ -131,7 +131,8 @@ struct server_stats {
        size_t unwanted_queries;
        /** usage of tcp accept list */
        size_t tcp_accept_usage;
-
+       /** answers served from expired cache */
+       size_t zero_ttl_responses;
        /** histogram data exported to array 
         * if the array is the same size, no data is lost, and
         * if all histograms are same size (is so by default) then
index 3c50567e4ed58d7c08eceaac86dda8f9fcb90241..d57c8b44dffed38c92ca9a9e658b53751b9ebff6 100644 (file)
@@ -563,6 +563,10 @@ answer_from_cache(struct worker* worker, struct query_info* qinfo,
                        return 0;
                /* below, rrsets with ttl before timenow become TTL 0 in
                 * the response */
+               /* This response was served with zero TTL */
+               if (timenow >= rep->ttl) {
+                       worker->stats.zero_ttl_responses++;
+               }
        } else {
                /* see if it is possible */
                if(rep->ttl < timenow) {
index 4cea84ca71052ed60dceabdb0990ac3d05132f36..b4653c4eab64c003bb7e886aebb8e2772b191cb7 100644 (file)
@@ -1,3 +1,7 @@
+28 October 2016: Wouter
+       - Patch for server.num.zero_ttl stats for count of expired replies,
+         from Pavel Odintsov.
+
 26 October 2016: Wouter
        - Fix unit tests for openssl 1.1, with no DSA, by faking DSA, enabled
          with the undocumented switch 'fake-dsa'.  It logs a warning.
index e7a18f47f6511900eb01e80494916692b64a94f6..5a0bff682dda53b6758f86b3ef18f46126692d54 100644 (file)
@@ -316,6 +316,9 @@ and resulted in recursive processing, taking a slot in the requestlist.
 Not part of the recursivereplies (or the histogram thereof) or cachemiss,
 as a cache response was sent.
 .TP
+.I threadX.num.zero_ttl
+number of replies with ttl zero, because they served an expired cache entry.
+.TP
 .I threadX.num.recursivereplies
 The number of replies sent to queries that needed recursive processing. Could be smaller than threadX.num.cachemiss if due to timeouts no replies were sent for some queries.
 .TP
@@ -365,6 +368,9 @@ summed over threads.
 .I total.num.prefetch
 summed over threads.
 .TP
+.I total.num.zero_ttl
+summed over threads.
+.TP
 .I total.num.recursivereplies
 summed over threads.
 .TP