mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Added flows and drops ts to netflow/sflow exporters
This commit is contained in:
parent
0dc6ff5b69
commit
6d0c53ffc6
6 changed files with 104 additions and 5 deletions
|
|
@ -75,6 +75,7 @@ function dumpInterfaceStats(ifid)
|
|||
interface.select(ifid .. '')
|
||||
|
||||
local ifstats = interface.getStats()
|
||||
local drops = 0
|
||||
|
||||
if interface.isView() then
|
||||
local zmq_stats = {}
|
||||
|
|
@ -84,9 +85,14 @@ function dumpInterfaceStats(ifid)
|
|||
for k, v in pairs(tmp.zmqRecvStats or {}) do
|
||||
zmq_stats[k] = (zmq_stats[k] or 0) + v
|
||||
end
|
||||
for k, v in pairs(tmp.exporters or {}) do
|
||||
drops = v["num_drops"] + drops
|
||||
end
|
||||
end
|
||||
ifstats.zmqRecvStats = zmq_stats
|
||||
interface.select(ifstats.id)
|
||||
elseif (ifstats) then
|
||||
drops = ifstats.stats_since_reset.drops
|
||||
end
|
||||
|
||||
local res = {}
|
||||
|
|
@ -107,7 +113,7 @@ function dumpInterfaceStats(ifid)
|
|||
-- so we must return statistics since the latest (possible) reset
|
||||
res["packets"] = ifstats.stats_since_reset.packets
|
||||
res["bytes"] = ifstats.stats_since_reset.bytes
|
||||
res["drops"] = ifstats.stats_since_reset.drops
|
||||
res["drops"] = drops
|
||||
|
||||
if ifstats.stats_since_reset.discarded_probing_packets then
|
||||
res["discarded_probing_packets"] = ifstats.stats_since_reset.discarded_probing_packets
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue