From d299d4f5ec6985ef439d3c546ee31ec1b5d868dc Mon Sep 17 00:00:00 2001 From: bert hubert Date: Mon, 17 Mar 2014 09:26:26 +0100 Subject: [PATCH] fix statistics when running with pdns-distributes-queries. Closes issue #1333. --- pdns/pdns_recursor.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 78f99db3c7..a729cf6fd4 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1113,11 +1113,11 @@ void doStats(void) { static time_t lastOutputTime; static uint64_t lastQueryCount; + + uint64_t cacheHits = broadcastAccFunction(pleaseGetCacheHits); + uint64_t cacheMisses = broadcastAccFunction(pleaseGetCacheMisses); - if(g_stats.qcounter && (t_RC->cacheHits + t_RC->cacheMisses) && SyncRes::s_queries && SyncRes::s_outqueries) { // this only runs once thread 0 has had hits - uint64_t cacheHits = broadcastAccFunction(pleaseGetCacheHits); - uint64_t cacheMisses = broadcastAccFunction(pleaseGetCacheMisses); - + if(g_stats.qcounter && (cacheHits + cacheMisses) && SyncRes::s_queries && SyncRes::s_outqueries) { L<(pleaseGetCacheSize)<< " cache entries, "<< broadcastAccFunction(pleaseGetNegCacheSize)<<" negative entries, "<< -- 2.47.3