From: ARUNKUMAR KAYAMBU -X (akayambu - XORIANT CORPORATION at Cisco) Date: Wed, 6 Mar 2024 14:07:02 +0000 (+0000) Subject: Pull request #4236: stats: fix timing stats X-Git-Tag: 3.1.82.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33eb80e1aaaf24fe752fd36044889fab31525a59;p=thirdparty%2Fsnort3.git Pull request #4236: stats: fix timing stats Merge in SNORT/snort3 from ~AKAYAMBU/snort3:timing_stats_fix to master Squashed commit of the following: commit 87f6beb339848be3b2175ee409cabab96b1a96e1 Author: Arunkumar Kayambu Date: Tue Mar 5 15:32:26 2024 -0500 stats: fix timing stats --- diff --git a/src/framework/module.cc b/src/framework/module.cc index ed0af5b53..08aac4f49 100644 --- a/src/framework/module.cc +++ b/src/framework/module.cc @@ -101,6 +101,8 @@ void Module::main_accumulate_stats() if (!global_stats()) { + //reset the results + std::fill(dump_stats_results.begin(), dump_stats_results.end(), 0); for ( int i = 0; i < num_counts; i++ ) { for ( unsigned thread_index = 0; thread_index < dump_stats_counts.size(); thread_index++) @@ -195,7 +197,6 @@ void Module::show_stats() { ::show_stats(&dump_stats_results[0], get_pegs(), num_counts, get_name()); dump_stats_initialized.assign(dump_stats_initialized.size(), 0); - std::fill(dump_stats_results.begin(), dump_stats_results.end(), 0); } }