mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Enhanced collector stats
This commit is contained in:
parent
895a1f7832
commit
e522eebf6b
8 changed files with 124 additions and 38 deletions
|
|
@ -115,6 +115,19 @@ function dumpInterfaceStats(ifid)
|
|||
res["bytes"] = ifstats.stats_since_reset.bytes
|
||||
res["drops"] = drops
|
||||
|
||||
local tot_pkt = 0
|
||||
local tot_pkt_drops = 0
|
||||
|
||||
for interface_id, probes_list in pairs(ifstats.probes or {}) do
|
||||
for source_id, probe_info in pairs(probes_list or {}) do
|
||||
tot_pkt = tot_pkt + probe_info["packets.total"]
|
||||
tot_pkt_drops = tot_pkt_drops + probe_info["packets.drops"]
|
||||
end
|
||||
end
|
||||
|
||||
res["tot_nprobe_pkts"] = tot_pkt
|
||||
res["tot_pkt_drops"] = tot_pkt_drops
|
||||
|
||||
if ifstats.stats_since_reset.discarded_probing_packets then
|
||||
res["discarded_probing_packets"] = ifstats.stats_since_reset.discarded_probing_packets
|
||||
res["discarded_probing_bytes"] = ifstats.stats_since_reset.discarded_probing_bytes
|
||||
|
|
@ -235,7 +248,7 @@ function dumpInterfaceStats(ifid)
|
|||
if (ifstats.zmqRecvStats ~= nil) then
|
||||
|
||||
if ifstats.zmqRecvStats_since_reset then
|
||||
-- override stats with the values calculated from the latest user reset
|
||||
-- override stats with the values calculated from the latest user reset
|
||||
-- for consistency with if_stats.lua
|
||||
for k, v in pairs(ifstats.zmqRecvStats_since_reset) do
|
||||
ifstats.zmqRecvStats[k] = v
|
||||
|
|
@ -327,7 +340,6 @@ function dumpBriefInterfaceStats(ifid)
|
|||
|
||||
res["ifid"] = ifid
|
||||
res["ifname"] = interface_name
|
||||
|
||||
res["drops"] = ifstats.stats_since_reset.drops
|
||||
|
||||
res["throughput_bps"] = ifstats.stats.throughput_bps;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ end
|
|||
interface.select(ifid)
|
||||
local if_names = interface.getIfNames()
|
||||
local ifstats = interface.getStats()
|
||||
local probes_stats = ifstats.probes or {}
|
||||
local timeseries_enabled = areFlowdevTimeseriesEnabled()
|
||||
|
||||
--tprint(ifstats) io.write("-----------------------\n")
|
||||
|
|
@ -67,13 +66,15 @@ for interface_id, probes_list in pairs(ifstats.probes or {}) do
|
|||
probe_maintenance = probe_info["probe.probe_maintenance"] or i18n("if_stats_overview.expired_maintenance"),
|
||||
flow_exporters = flow_exporters_num,
|
||||
dropped_flows = flow_drops,
|
||||
dropped_packets = (probe_info["drops.packet_drops"] or 0),
|
||||
captured_packets = (probe_info["packets.total"] or 0),
|
||||
dropped_packets = (probe_info["packets.drops"] or 0),
|
||||
exported_flows = exported_flows,
|
||||
ntopng_interface = if_names[tostring(interface_id)],
|
||||
timeseries_enabled = timeseries_enabled,
|
||||
ifid = interface_id
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
rest_utils.answer(rc, res)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue