mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Implement layer above RRD for timeseries storage
This commit is contained in:
parent
d161704639
commit
cb56b5d5ec
12 changed files with 1038 additions and 293 deletions
|
|
@ -952,64 +952,6 @@ else
|
|||
end
|
||||
end
|
||||
|
||||
function createRRDcounter(path, step, verbose)
|
||||
if(not(ntop.exists(path))) then
|
||||
if(verbose) then print('Creating RRD ', path, '\n') end
|
||||
local prefs = ntop.getPrefs()
|
||||
local hb = step * 5 -- keep it aligned with rrd_utils.makeRRD
|
||||
ntop.rrd_create(
|
||||
path,
|
||||
step, -- step
|
||||
'DS:sent:DERIVE:'..hb..':U:U',
|
||||
'DS:rcvd:DERIVE:'..hb..':U:U',
|
||||
'RRA:AVERAGE:0.5:1:'..tostring(prefs.other_rrd_raw_days*24*(3600/step)), -- raw: 1 day = 1 * 24 = 24 * 12 = 288
|
||||
'RRA:AVERAGE:0.5:'..(3600/step)..':'..tostring(prefs.other_rrd_1h_days*24), -- 1h resolution (12 points) 2400 hours = 100 days
|
||||
'RRA:AVERAGE:0.5:'..(86400/step)..':'..tostring(prefs.other_rrd_1d_days) -- 1d resolution (288 points) 365 days
|
||||
--'RRA:HWPREDICT:1440:0.1:0.0035:20'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
function createSingleRRDcounter(path, step, verbose)
|
||||
if(not(ntop.exists(path))) then
|
||||
if(verbose) then print('Creating RRD ', path, '\n') end
|
||||
local prefs = ntop.getPrefs()
|
||||
local hb = step * 5 -- keep it aligned with rrd_utils.makeRRD
|
||||
ntop.rrd_create(
|
||||
path,
|
||||
step, -- step
|
||||
'DS:num:DERIVE:'..hb..':U:U',
|
||||
'RRA:AVERAGE:0.5:1:'..tostring(prefs.other_rrd_raw_days*24*(3600/step)), -- raw: 1 day = 1 * 24 = 24 * 12 = 288
|
||||
'RRA:AVERAGE:0.5:'..(3600/step)..':'..tostring(prefs.other_rrd_1h_days*24), -- 1h resolution (12 points) 2400 hours = 100 days
|
||||
'RRA:AVERAGE:0.5:'..(86400/step)..':'..tostring(prefs.other_rrd_1d_days) -- 1d resolution (288 points) 365 days
|
||||
-- 'RRA:HWPREDICT:1440:0.1:0.0035:20'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
-- this method will be very likely used when saving subnet rrd traffic statistics
|
||||
function createTripleRRDcounter(path, step, verbose)
|
||||
if(not(ntop.exists(path))) then
|
||||
if(verbose) then io.write('Creating RRD '..path..'\n') end
|
||||
local prefs = ntop.getPrefs()
|
||||
local hb = step * 5 -- keep it aligned with rrd_utils.makeRRD
|
||||
ntop.rrd_create(
|
||||
path,
|
||||
step, -- step
|
||||
'DS:ingress:DERIVE:'..hb..':U:U',
|
||||
'DS:egress:DERIVE:'..hb..':U:U',
|
||||
'DS:inner:DERIVE:'..hb..':U:U',
|
||||
'RRA:AVERAGE:0.5:1:'..tostring(prefs.other_rrd_raw_days*24*(3600/step)), -- raw: 1 day = 1 * 24 = 24 * 12 = 288
|
||||
'RRA:AVERAGE:0.5:12:'..tostring(prefs.other_rrd_1h_days*24), -- 1h resolution (12 points) 2400 hours = 100 days
|
||||
'RRA:AVERAGE:0.5:288:'..tostring(prefs.other_rrd_1d_days) -- 1d resolution (288 points) 365 days
|
||||
--'RRA:HWPREDICT:1440:0.1:0.0035:20'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
function printGraphTopFlows(ifId, host, epoch, zoomLevel, l7proto, vlan)
|
||||
-- Check if the DB is enabled
|
||||
rsp = interface.execSQLQuery("show tables")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue