#include <Statistics.hpp>
Public Member Functions | |
| Statistics (std::size_t max_events=250) | |
| void | record (const bsc::model::Connection &conn, const std::string &action, const std::string &rule_name) |
| void | note_dns_response () |
| std::uint64_t | connections () const |
| std::uint64_t | accepted () const |
| std::uint64_t | dropped () const |
| std::uint64_t | ignored () const |
| std::uint64_t | rules () const |
| std::uint64_t | dns_responses () const |
| std::uint64_t | rule_hits () const |
| std::uint64_t | rule_misses () const |
| std::map< std::string, std::uint64_t > | by_proto () const |
| std::map< std::string, std::uint64_t > | by_address () const |
| std::map< std::string, std::uint64_t > | by_host () const |
| std::map< std::string, std::uint64_t > | by_port () const |
| std::map< std::string, std::uint64_t > | by_uid () const |
| std::map< std::string, std::uint64_t > | by_executable () const |
| std::deque< Event > | events () const |
Private Attributes | |
| std::mutex | mutex_ |
| std::size_t | max_events_ |
| std::uint64_t | rules_ {0} |
| std::uint64_t | connections_ {0} |
| std::uint64_t | ignored_ {0} |
| std::uint64_t | accepted_ {0} |
| std::uint64_t | dropped_ {0} |
| std::uint64_t | dns_responses_ {0} |
| std::uint64_t | rule_hits_ {0} |
| std::uint64_t | rule_misses_ {0} |
| std::map< std::string, std::uint64_t > | by_proto_ |
| std::map< std::string, std::uint64_t > | by_address_ |
| std::map< std::string, std::uint64_t > | by_host_ |
| std::map< std::string, std::uint64_t > | by_port_ |
| std::map< std::string, std::uint64_t > | by_uid_ |
| std::map< std::string, std::uint64_t > | by_executable_ |
| std::deque< Event > | events_ |
Definition at line 18 of file Statistics.hpp.
|
explicit |
Definition at line 18 of file Statistics.cpp.
References max_events_.
|
nodiscard |
Definition at line 40 of file Statistics.cpp.
|
nodiscard |
Definition at line 49 of file Statistics.cpp.
References by_address_, and mutex_.
|
nodiscard |
Definition at line 53 of file Statistics.cpp.
References by_executable_, and mutex_.
|
nodiscard |
Definition at line 50 of file Statistics.cpp.
|
nodiscard |
Definition at line 51 of file Statistics.cpp.
|
nodiscard |
Definition at line 48 of file Statistics.cpp.
|
nodiscard |
Definition at line 52 of file Statistics.cpp.
|
nodiscard |
|
nodiscard |
|
nodiscard |
Definition at line 41 of file Statistics.cpp.
|
nodiscard |
Definition at line 54 of file Statistics.cpp.
|
nodiscard |
Definition at line 42 of file Statistics.cpp.
| void bsc::stats::Statistics::note_dns_response | ( | ) |
| void bsc::stats::Statistics::record | ( | const bsc::model::Connection & | conn, |
| const std::string & | action, | ||
| const std::string & | rule_name ) |
Definition at line 20 of file Statistics.cpp.
References accepted_, by_address_, by_executable_, by_host_, by_port_, by_proto_, by_uid_, connections_, dropped_, bsc::model::Connection::dst_host, bsc::model::Connection::dst_ip, bsc::model::Connection::dst_port, events_, ignored_, max_events_, mutex_, bsc::model::Connection::process_path, bsc::model::Connection::protocol, rule_hits_, rule_misses_, rules_, and bsc::model::Connection::user_id.
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
private |
Definition at line 44 of file Statistics.hpp.
Referenced by accepted(), and record().
|
private |
Definition at line 50 of file Statistics.hpp.
Referenced by by_address(), and record().
|
private |
Definition at line 54 of file Statistics.hpp.
Referenced by by_executable(), and record().
|
private |
Definition at line 51 of file Statistics.hpp.
|
private |
Definition at line 52 of file Statistics.hpp.
|
private |
Definition at line 49 of file Statistics.hpp.
Referenced by by_proto(), and record().
|
private |
Definition at line 53 of file Statistics.hpp.
|
private |
Definition at line 42 of file Statistics.hpp.
Referenced by connections(), and record().
|
private |
Definition at line 46 of file Statistics.hpp.
Referenced by dns_responses(), and note_dns_response().
|
private |
Definition at line 45 of file Statistics.hpp.
|
private |
Definition at line 55 of file Statistics.hpp.
|
private |
Definition at line 43 of file Statistics.hpp.
|
private |
Definition at line 40 of file Statistics.hpp.
Referenced by record(), and Statistics().
|
mutableprivate |
Definition at line 39 of file Statistics.hpp.
Referenced by accepted(), by_address(), by_executable(), by_host(), by_port(), by_proto(), by_uid(), connections(), dns_responses(), dropped(), events(), ignored(), note_dns_response(), record(), rule_hits(), rule_misses(), and rules().
|
private |
Definition at line 47 of file Statistics.hpp.
Referenced by record(), and rule_hits().
|
private |
Definition at line 48 of file Statistics.hpp.
Referenced by record(), and rule_misses().
|
private |
Definition at line 41 of file Statistics.hpp.