]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4236: stats: fix timing stats
authorARUNKUMAR KAYAMBU -X (akayambu - XORIANT CORPORATION at Cisco) <akayambu@cisco.com>
Wed, 6 Mar 2024 14:07:02 +0000 (14:07 +0000)
committerSteven Baigal (sbaigal) <sbaigal@cisco.com>
Wed, 6 Mar 2024 14:07:02 +0000 (14:07 +0000)
Merge in SNORT/snort3 from ~AKAYAMBU/snort3:timing_stats_fix to master

Squashed commit of the following:

commit 87f6beb339848be3b2175ee409cabab96b1a96e1
Author: Arunkumar Kayambu <akayambu@cisco.com>
Date:   Tue Mar 5 15:32:26 2024 -0500

    stats: fix timing stats

src/framework/module.cc

index ed0af5b53747a2986e0276828cfad71b79bb67d4..08aac4f498ba4660104943f18975e0296b680dc1 100644 (file)
@@ -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);
     }
 }