Possible fix related to empty timeseries chart

This commit is contained in:
Matteo Biscosi 2025-09-30 16:18:13 +02:00
parent 996ea35acd
commit b2fe708dbc
6 changed files with 29 additions and 20 deletions

View file

@ -3573,7 +3573,7 @@ function timeseries_info.retrieve_community_timeseries()
end
-- #################################
function timeseries_info.retrieve_specific_timeseries(tags, prefix)
function timeseries_info.retrieve_specific_timeseries(tags, prefix, include_empty_ts)
local timeseries_list = community_timeseries
local timeseries = {}
@ -3631,15 +3631,17 @@ function timeseries_info.retrieve_specific_timeseries(tags, prefix)
goto skip
end
-- Remove empty timeseries but exclude the ones starting with top: from the check
if not (info.schema:match("^top:")) then
local tmp_tags = table.clone(tags)
if not include_empty_ts then
-- Remove empty timeseries but exclude the ones starting with top: from the check
if not (info.schema:match("^top:")) then
local tmp_tags = table.clone(tags)
local tot = 0
local tot_serie = ts_utils.queryTotal(info.schema,
tags.epoch_begin,
tags.epoch_end, tmp_tags)
if not tot_serie then goto skip end
local tot = 0
local tot_serie = ts_utils.queryTotal(info.schema,
tags.epoch_begin,
tags.epoch_end, tmp_tags)
if not tot_serie then goto skip end
end
end
timeseries[#timeseries + 1] = info