mirror of
https://github.com/ntop/ntopng.git
synced 2026-07-09 16:00:51 +00:00
Fixed network issues check (#10559)
This commit is contained in:
parent
d1762b5f6f
commit
f6ac4235f5
1 changed files with 10 additions and 4 deletions
|
|
@ -107,10 +107,16 @@ local function check_network_issues(params)
|
|||
|
||||
end
|
||||
|
||||
-- to percentage
|
||||
local lost = format_utils.round((100 * tot_lost) / tot_packets, 1)
|
||||
local out_of_orders = format_utils.round((100 * tot_out_of_order) / tot_packets, 1)
|
||||
local retransmissions = format_utils.round((100 * tot_retransmissions) / tot_packets, 1)
|
||||
local lost, out_of_orders, retransmissions = 0, 0, 0
|
||||
|
||||
-- local network can have zero packets in the granularity window
|
||||
-- (e.g. idle network or freshly created). In that case tot_packets == 0
|
||||
-- and the divisions below would yield 0/0 == NaN
|
||||
if tot_packets > 0 then
|
||||
lost = format_utils.round((100 * tot_lost) / tot_packets, 1)
|
||||
out_of_orders = format_utils.round((100 * tot_out_of_order) / tot_packets, 1)
|
||||
retransmissions = format_utils.round((100 * tot_retransmissions) / tot_packets, 1)
|
||||
end
|
||||
|
||||
-- take thresholds
|
||||
local retransmissions_threshold = (params.check_config.retransmissions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue