mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
Fixed traffic stats chart in flows
This commit is contained in:
parent
7a5869f729
commit
fe74fb4f14
4 changed files with 37 additions and 36 deletions
|
|
@ -17,7 +17,7 @@ local rest_utils = require("rest_utils")
|
|||
--
|
||||
local flows_filter = getFlowsFilter()
|
||||
local rc = rest_utils.consts.success.ok
|
||||
local res = {}
|
||||
local res
|
||||
|
||||
local ifid = _GET["ifid"]
|
||||
|
||||
|
|
@ -30,18 +30,6 @@ end
|
|||
interface.select(ifid)
|
||||
|
||||
-- This is used to get the current bytes rcvd and sent by these specific filters
|
||||
filtered_traffic_stats = interface.getFlowsTrafficStats(flows_filter["hostFilter"], flows_filter, true)
|
||||
|
||||
res["throughput_bps_sent"] = (filtered_traffic_stats["flows"]["totNewBytesSent"] - filtered_traffic_stats["flows"]["totOldBytesSent"]) / 5
|
||||
|
||||
res["throughput_bps_rcvd"] = (filtered_traffic_stats["flows"]["totNewBytesRcvd"] - filtered_traffic_stats["flows"]["totOldBytesRcvd"]) / 5
|
||||
|
||||
if res["throughput_bps_sent"] < 0 then
|
||||
res["throughput_bps_sent"] = 0
|
||||
end
|
||||
|
||||
if res["throughput_bps_rcvd"] < 0 then
|
||||
res["throughput_bps_rcvd"] = 0
|
||||
end
|
||||
res = interface.getFlowsTrafficStats(flows_filter["hostFilter"], flows_filter, true)
|
||||
|
||||
rest_utils.answer(rc, res)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue