Patricia tree, Ahocarasick automa, LRU cache: add statistics (#1683)

Add (basic) internal stats to the main data structures used by the
library; they might be usefull to check how effective these structures
are.

Add an option to `ndpiReader` to dump them; enabled by default in the
unit tests.
This new option enables/disables dumping of "num dissectors calls"
values, too (see b4cb14ec).
This commit is contained in:
Ivan Nardi
2022-07-29 15:25:00 +02:00
committed by GitHub
parent df2e11ef51
commit 405a52ed65
369 changed files with 5773 additions and 18 deletions
+4
View File
@@ -298,6 +298,10 @@ typedef struct ndpi_stats {
u_int64_t dpi_packet_count[3];
u_int64_t flow_confidence[NDPI_CONFIDENCE_MAX];
u_int64_t num_dissector_calls;
struct ndpi_lru_cache_stats lru_stats[NDPI_LRUCACHE_MAX];
struct ndpi_automa_stats automa_stats[NDPI_AUTOMA_MAX];
struct ndpi_patricia_tree_stats patricia_stats[NDPI_PTREE_MAX];
} ndpi_stats_t;