scripts/lua/host_interaction.lua: add max hosts threshold

This commit helps reducing the extent of the hosts interaction map
by implementing a simple threshold as a workaround to avoid unusable
maps for large networks. This is a first workaround for #42, while
the map will be completely reworked shortly.
This commit is contained in:
Arianna Avanzini 2015-07-03 03:58:28 +02:00
parent 2441f9da71
commit 7d3bbc1d1a

View file

@ -339,6 +339,8 @@ ids = {}
num = 0
links = 0
local host
local max_num_hosts = 50
local host_idx = 0
for key, values in pairs(hosts_stats) do
@ -401,6 +403,11 @@ for key, values in pairs(hosts_stats) do
end
end
end
host_idx = host_idx + 1
if (host_idx > max_num_hosts) then
break
end
end
aggregation_ids = {}