mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 10:41:34 +00:00
Properly skip InfluxDB empty points
This commit is contained in:
parent
186fad5b09
commit
6ab25c9207
1 changed files with 15 additions and 12 deletions
|
|
@ -103,6 +103,11 @@ local function influx2Series(schema, tstart, tend, tags, options, data, time_ste
|
|||
for idx, values in ipairs(data.values) do
|
||||
local cur_t = data.values[idx][1]
|
||||
|
||||
if #values < 1 then
|
||||
-- skip empty points (which are out of query bounds)
|
||||
goto continue
|
||||
end
|
||||
|
||||
if (idx == 1) and (data_type ~= ts_common.metrics.counter) then
|
||||
-- skip first point when no derivative is performed as an issue with GROUP BY
|
||||
goto continue
|
||||
|
|
@ -119,23 +124,21 @@ local function influx2Series(schema, tstart, tend, tags, options, data, time_ste
|
|||
prev_t = prev_t + time_step
|
||||
end
|
||||
|
||||
if #values > 1 then
|
||||
for i=2, #values do
|
||||
local val = values[i]
|
||||
for i=2, #values do
|
||||
local val = values[i]
|
||||
|
||||
if val < options.min_value then
|
||||
val = options.min_value
|
||||
elseif val > options.max_value then
|
||||
val = options.max_value
|
||||
end
|
||||
|
||||
series[i-1].data[series_idx] = val
|
||||
if val < options.min_value then
|
||||
val = options.min_value
|
||||
elseif val > options.max_value then
|
||||
val = options.max_value
|
||||
end
|
||||
|
||||
series_idx = series_idx + 1
|
||||
prev_t = prev_t + time_step
|
||||
series[i-1].data[series_idx] = val
|
||||
end
|
||||
|
||||
series_idx = series_idx + 1
|
||||
prev_t = prev_t + time_step
|
||||
|
||||
::continue::
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue