Fix issue with empty points in influxDB gauge metrics

This commit is contained in:
emanuele-f 2018-07-20 13:47:13 +02:00
parent 667bc2e8c6
commit d0169db76d

View file

@ -112,20 +112,23 @@ local function influx2Series(schema, tstart, tend, tags, options, data, time_ste
prev_t = prev_t + time_step
end
for i=2, #values do
local val = values[i]
if #values > 1 then
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
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
end
series[i-1].data[series_idx] = val
series_idx = series_idx + 1
prev_t = cur_t
end
series_idx = series_idx + 1
prev_t = cur_t
::continue::
end