mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Reworked hosts listing in order to avoid/limit out-of-memory issues
Implemented aggregation of hosts and flows when using views
This commit is contained in:
parent
df957f9e55
commit
11f8c934d0
40 changed files with 391 additions and 354 deletions
|
|
@ -82,6 +82,44 @@ function aggregateInterfaceStats(ifstats)
|
|||
return(ifstats)
|
||||
end
|
||||
|
||||
-- ##########################################
|
||||
|
||||
function aggregateHostsStats(hostStats)
|
||||
if(hostStats == nil) then return(hostStats) end
|
||||
|
||||
local tot = 0
|
||||
local res = { }
|
||||
for ifname,_v in pairs(hostStats) do
|
||||
for k,v in pairs(_v["hosts"]) do
|
||||
--io.write(k.."\n")
|
||||
res[k] = v
|
||||
end
|
||||
|
||||
tot = tot + _v["numHosts"]
|
||||
end
|
||||
|
||||
return res,tot
|
||||
end
|
||||
|
||||
-- ##########################################
|
||||
|
||||
function aggregateFlowsStats(flowstats)
|
||||
if(flowstats == nil) then return(flowstats) end
|
||||
|
||||
local tot = 0
|
||||
local res = { }
|
||||
for ifname,_v in pairs(flowstats) do
|
||||
for k,v in pairs(_v["flows"]) do
|
||||
--io.write(k.."\n")
|
||||
res[k] = v
|
||||
end
|
||||
|
||||
tot = tot + _v["numFlows"]
|
||||
end
|
||||
|
||||
return res,tot
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function getInterfaceName(interface_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue