mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 19:15:03 +00:00
Improved low-threshold script skip
This commit is contained in:
parent
10b27b12c8
commit
f7bddc7e0a
1 changed files with 7 additions and 3 deletions
|
|
@ -20,7 +20,8 @@ local ht_stats = interface.getHashTablesStats()
|
|||
local idle_flows = ht_stats.FlowHash.hash_entry_states.hash_entry_state_idle
|
||||
local active_flows = ht_stats.FlowHash.hash_entry_states.hash_entry_state_active
|
||||
local idle_ratio_threshold = 66.
|
||||
local idle_flows_threshold = 100000
|
||||
local idle_flows_high_threshold = 100000
|
||||
local idle_flows_low_threshold = 1000
|
||||
local idle_ratio
|
||||
|
||||
if(active_flows == 0) then
|
||||
|
|
@ -29,9 +30,12 @@ else
|
|||
idle_ratio = (100 * idle_flows) / active_flows
|
||||
end
|
||||
|
||||
if((idle_flows > idle_flows_threshold) or (idle_ratio > idle_ratio_threshold)) then
|
||||
if(
|
||||
(idle_flows > idle_flows_high_threshold)
|
||||
or ((idle_ratio > idle_ratio_threshold) and (idle_flows > idle_flows_low_threshold))
|
||||
) then
|
||||
skip_user_scripts = true
|
||||
io.write("[ht_state_update.lua] Skipping scripts on ".. interface.getName() ..": [idle ratio: "..idle_ratio.."]\n")
|
||||
io.write("[ht_state_update.lua] Skipping scripts on ".. interface.getName() ..": [idle ratio: "..idle_ratio.."]["..idle_flows.."/"..active_flows.."]\n")
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue