mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Add experimental support for 5sec granularity for host timeseries
To enable it (only on *InfluxDB* right now): - uncomment HOST_NUM_TIMESERIES_POINTS in ntop_defines.h - run `redis-cli set ntopng.prefs.30_sec_dump 1` and restart ntopng
This commit is contained in:
parent
413c265ecb
commit
0004e08191
24 changed files with 354 additions and 106 deletions
|
|
@ -106,16 +106,28 @@ end
|
|||
|
||||
-- ########################################################
|
||||
|
||||
function callback_utils.is30SecDumpEnabled()
|
||||
return ntop.getPref("ntopng.prefs.30_sec_dump") == "1"
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
-- Iterates each active host on the ifname interface for RRD creation.
|
||||
-- Each host is passed to the callback with some more information.
|
||||
function callback_utils.foreachLocalRRDHost(ifname, deadline, callback)
|
||||
interface.select(ifname)
|
||||
|
||||
local iterator = callback_utils.getLocalHostsIterator(false --[[ no details ]])
|
||||
local dump30sec = callback_utils.is30SecDumpEnabled()
|
||||
|
||||
for hostname, hoststats in iterator do
|
||||
-- Note: this is expensive
|
||||
local host = interface.getHostInfo(hostname)
|
||||
local host
|
||||
|
||||
if dump30sec then
|
||||
host = interface.getHostTimeseries(hostname) or {}
|
||||
else
|
||||
host = interface.getHostInfo(hostname)
|
||||
end
|
||||
|
||||
if(ntop.isShutdown()) then return true end
|
||||
if ((deadline ~= nil) and (os.time() >= deadline)) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue