Report packet statistics via the telemetry framework

This commit is contained in:
Tim Wojtulewicz 2023-03-31 16:44:46 -07:00
parent ae3d6a4df0
commit 67802e711a
6 changed files with 62 additions and 8 deletions

View file

@ -432,7 +432,8 @@ void get_final_stats()
std::string filtered = "";
if ( s.filtered )
{
double filtered_pct = s.filtered ? pct(s.filtered.value(), s.received) : 0.0;
double filtered_pct = s.filtered.value() > 0 ? pct(s.filtered.value(), s.received)
: 0.0;
filtered = zeek::util::fmt(" %" PRIu64 " (%.2f%%) filtered", s.filtered.value(),
filtered_pct);
}