mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
Zeek Statistics
- Added statistics hook - Fixed rlimit usage - Removed POpen for windows implementation layer - Completed statistics plugin
This commit is contained in:
parent
fbf5b68d6f
commit
c3b9756576
8 changed files with 135 additions and 0 deletions
29
src/statistics/Plugin.h
Normal file
29
src/statistics/Plugin.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include "zeek/plugin/Plugin.h"
|
||||
|
||||
namespace zeek::plugin::statistics {
|
||||
|
||||
class Plugin : public zeek::plugin::Plugin
|
||||
{
|
||||
protected:
|
||||
bool HookQueueEvent(zeek::Event* event) override;
|
||||
|
||||
zeek::plugin::Configuration Configure() override;
|
||||
|
||||
public:
|
||||
std::unordered_map<const char*, int> GetAndResetEventStatistics();
|
||||
void StartEventNamesStatisticsMonitor();
|
||||
|
||||
private:
|
||||
std::unordered_map<const char*, int> m_eventNameCounters;
|
||||
std::mutex m_lock;
|
||||
|
||||
};
|
||||
|
||||
extern Plugin plugin;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue