Excludes Layer-4 protocols from stacked charts

Layer4 protocols such as UDP and TCP were stacked up along with
Layer7 protocols, yielding wrong total traffic values.

This commit fixes the issue
This commit is contained in:
Simone Mainardi 2017-06-09 14:16:02 +02:00
parent 1c579b5643
commit 1e99d4b217

View file

@ -418,6 +418,16 @@ function isTopRRD(filename)
return false
end
function isLayer4RRD(filename)
for _, l4 in pairs(l4_keys) do
if filename:starts(l4[2]) or filename:starts(l4[1]) then
return true
end
end
return false
end
-- ########################################################
function printTopRRDs(ifid, host, start_time, baseurl, zoomLevel, selectedEpoch)
@ -1511,6 +1521,12 @@ function rrd2json(ifid, host, rrdFile, start_time, end_time, rickshaw_json, expa
d = fixPath(p)
rrds = navigatedir("", "*", d, d, go_deep, false, ifid, host, start_time, end_time)
for key, value in pairs(rrds) do
if isLayer4RRD(key) then
rrds[key] = nil
end
end
local traffic_array = {}
for key, value in pairs(rrds) do
rsp = singlerrd2json(ifid, host, value, start_time, end_time, rickshaw_json, expand_interface_views)