Fixes for tests alert_web_mining and invalid_dns_query

This commit is contained in:
Simone Mainardi 2021-07-20 09:57:59 +02:00
parent 0f8b71b9ef
commit b108cfbd30
7 changed files with 17 additions and 8 deletions

View file

@ -550,10 +550,10 @@ function driver:query(schema, tstart, tend, tags, options)
-- Avoid reporting the last point when the timeseries write has not completed
-- yet. Use 2*step as a bound.
if((tend > last_update) and ((tend - last_update) <= 2*schema.options.step)) then
tend = last_update
tend = last_update
end
--tprint("rrdtool fetch ".. rrdfile.. " " .. getConsolidationFunction(schema) .. " -s ".. tstart .. " -e " .. tend)
-- tprint("rrdtool fetch ".. rrdfile.. " " .. getConsolidationFunction(schema) .. " -s ".. tstart .. " -e " .. tend)
local fstart, fstep, fdata, fend, fcount = ntop.rrd_fetch_columns(rrdfile, getConsolidationFunction(schema), tstart, tend)
if fdata == nil then
@ -563,6 +563,11 @@ function driver:query(schema, tstart, tend, tags, options)
local count = 0
local series = {}
if schema.name == "iface:traffic_rxtx" then
tprint(debug.traceback())
-- tprint({getConsolidationFunction(schema), formatEpoch(fstart), fstep, formatEpoch(fend), fcount})
end
for name_key, serie in pairs(fdata) do
local serie_idx = map_rrd_column_to_metrics(schema, name_key)
local name = schema._metrics[serie_idx]