mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Show percentage of packets dropped in the final process output
This commit is contained in:
parent
fda8e3fd79
commit
6ddcc87c48
1 changed files with 3 additions and 2 deletions
|
@ -364,8 +364,9 @@ void net_get_final_stats()
|
|||
{
|
||||
iosource::PktSrc::Stats s;
|
||||
ps->Statistics(&s);
|
||||
reporter->Info("%" PRIu64 " packets received on interface %s, %" PRIu64 " dropped",
|
||||
s.received, ps->Path().c_str(), s.dropped);
|
||||
double dropped_pct = s.dropped > 0.0 ? ((double)s.dropped / ((double)s.received + (double)s.dropped)) * 100.0 : 0.0;
|
||||
reporter->Info("%" PRIu64 " packets received on interface %s, %" PRIu64 " (%.2f%%) dropped",
|
||||
s.received, ps->Path().c_str(), s.dropped, dropped_pct);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue