Implements MySQL Top Talkers Retrieval and Visualization

Overal Top Talkers are retrieved with just one single
MySQL query and include both ipv4 and ipv4. Top talkers
can be visualized on a per-interface and per-host basis,
and can be sliced and diced.
This commit is contained in:
Simone Mainardi 2016-02-08 21:35:27 +01:00
parent bfb47398b3
commit 08622e8f18
4 changed files with 110 additions and 12 deletions

View file

@ -111,13 +111,13 @@ local res = {["status"] = "unable to parse the request, please check input param
if stats_type == "top_talkers" then
if not peer1 and not peer2 then
-- compute the top-talkers for the selected time interval
res = require("top_scripts.top_talkers").getHistoricalTopInInterval(ifid, ifname, epoch_start + 60, epoch_end + 60, add_vlan)
res = getOverallTopTalkers(ifid, nil, epoch_start, epoch_end, sort_column, sort_order, offset, limit)
for _, record in pairs(res) do
record["label"] = ntop.getResolvedAddress(record["addr"])
end
else
res = getHostTopTalkers(ifid, peer1, nil, epoch_start + 60, epoch_end + 60)
res = getHostTopTalkers(ifid, peer1, nil, epoch_start, epoch_end, sort_column, sort_order, offset, limit)
for _, record in pairs(res) do
record["label"] = ntop.getResolvedAddress(record["addr"])
@ -125,7 +125,7 @@ if stats_type == "top_talkers" then
-- tprint(res)
end
elseif stats_type =="top_applications" then
res = getTopApplications(ifid, peer1, peer2, nil, epoch_start + 60, epoch_end + 60, sort_column, sort_order, offset, limit)
res = getTopApplications(ifid, peer1, peer2, nil, epoch_start, epoch_end, sort_column, sort_order, offset, limit)
-- add protocol labels
for _, record in pairs(res) do