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

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; disabled by default to avoid
too much fuss with the unit tests.
This commit is contained in:
Ivan Nardi
2022-07-29 12:07:41 +02:00
committed by GitHub
parent 95e16872fa
commit bb83899985
9 changed files with 378 additions and 8 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;