mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Fixes ts partially seen (#7913)
This commit is contained in:
parent
f246bd4512
commit
80038a8faf
10 changed files with 89 additions and 40 deletions
|
|
@ -519,12 +519,25 @@ function driver:timeseries_query(options)
|
|||
local fdata_name = names[serie_idx]
|
||||
local serie = fdata[fdata_name]
|
||||
local modified_serie = {}
|
||||
local num_not_nan_pts = 0
|
||||
count = 0
|
||||
|
||||
for i, v in pairs(serie) do
|
||||
-- Keep track of NaN points
|
||||
if v == v then
|
||||
num_not_nan_pts = num_not_nan_pts + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- Normalize the value
|
||||
for i, v in pairs(serie) do
|
||||
modified_serie[i] = ts_common.normalizeVal(v, max_val, options)
|
||||
count = count + 1
|
||||
-- Not enough point to represent the data, empty the serie
|
||||
if num_not_nan_pts >= options.min_num_points then
|
||||
modified_serie[i] = ts_common.normalizeVal(v, max_val, options)
|
||||
count = count + 1
|
||||
else
|
||||
modified_serie[i] = options.fill_value
|
||||
end
|
||||
end
|
||||
|
||||
series[#series + 1] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue