Merge in SNORT/snort3 from ~YVELYKOZ/snort3:global_counters to master
Squashed commit of the following:
commit
650effed988e6f87f2d7d5c19c6fc9e7f13ee3a8
Author: Yehor Velykozhon <yvelykoz@cisco.com>
Date: Tue Jan 30 16:05:15 2024 +0200
main: reset main-thread stats from the main thread
ACResetStats::~ACResetStats()
{
+ // Destructor is called only from main thread,
+ // main-thread stats are reset here.
+
if (requested_type == TYPE_MODULE or requested_type == TYPE_ALL)
ModuleManager::reset_module_stats("memory");
+
+ if (requested_type == TYPE_SNORT or requested_type == TYPE_ALL)
+ ModuleManager::reset_module_stats("snort");
}
bool ACSwap::execute(Analyzer& analyzer, void** ac_state)
void sum_stats(bool) override
{ } // accumulate externally
+ void reset_stats() override
+ {
+ if (snort::in_main_thread())
+ Module::reset_stats();
+ }
+
ProfileStats* get_profile(unsigned, const char*&, const char*&) const override;
Usage get_usage() const override