From 9f49585a63fa8fc648ed894b59601e5ad1948cf0 Mon Sep 17 00:00:00 2001 From: Ralph Dolmans Date: Thu, 3 Aug 2017 10:50:46 +0000 Subject: [PATCH] - Do not reset rrset.bogus stats when called using stats_noreset. git-svn-id: file:///svn/unbound/trunk@4291 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/stats.c | 6 +++--- doc/Changelog | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/daemon/stats.c b/daemon/stats.c index 599f39bcd..50233f4ac 100644 --- a/daemon/stats.c +++ b/daemon/stats.c @@ -123,7 +123,7 @@ void server_stats_log(struct ub_server_stats* stats, struct worker* worker, /** get rrsets bogus number from validator */ static size_t -get_rrset_bogus(struct worker* worker) +get_rrset_bogus(struct worker* worker, int reset) { int m = modstack_find(&worker->env.mesh->mods, "validator"); struct val_env* ve; @@ -133,7 +133,7 @@ get_rrset_bogus(struct worker* worker) ve = (struct val_env*)worker->env.modinfo[m]; lock_basic_lock(&ve->bogus_lock); r = ve->num_rrset_bogus; - if(!worker->env.cfg->stat_cumulative) + if(reset && !worker->env.cfg->stat_cumulative) ve->num_rrset_bogus = 0; lock_basic_unlock(&ve->bogus_lock); return r; @@ -169,7 +169,7 @@ server_stats_compile(struct worker* worker, struct ub_stats_info* s, int reset) s->svr.qtcp_outgoing = (long long)worker->back->num_tcp_outgoing; /* get and reset validator rrset bogus number */ - s->svr.rrset_bogus = (long long)get_rrset_bogus(worker); + s->svr.rrset_bogus = (long long)get_rrset_bogus(worker, reset); /* get cache sizes */ s->svr.msg_cache_count = (long long)count_slabhash_entries(worker->env.msg_cache); diff --git a/doc/Changelog b/doc/Changelog index 6fc200c29..cc9e36057 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 3 August 2017: Ralph - Remove unused iter_env member (ip6arpa_dname) + - Do not reset rrset.bogus stats when called using stats_noreset. 3 August 2017: Wouter - Fix #1394: mix of serve-expired and response-ip could cause a crash. -- 2.47.3