Fix system interface timeseries cleanup

This commit is contained in:
emanuele-f 2019-07-05 16:22:36 +02:00
parent 94f894454c
commit a3e1744353
16 changed files with 70 additions and 27 deletions

View file

@ -80,13 +80,17 @@ function ts_schema:new(name, options)
end
function ts_schema:addTag(name)
self._tags[#self._tags + 1] = name
self.tags[name] = 1
if self.tags[name] == nil then
self._tags[#self._tags + 1] = name
self.tags[name] = 1
end
end
function ts_schema:addMetric(name)
self._metrics[#self._metrics + 1] = name
self.metrics[name] = 1
if self.metrics[name] == nil then
self._metrics[#self._metrics + 1] = name
self.metrics[name] = 1
end
end
function ts_schema:allTagsDefined(tags)
@ -146,6 +150,14 @@ function ts_schema:verifyTagsAndMetrics(tags_and_metrics)
end
end
-- NOTE: the ifid tag is required in order to identify all the ts of
-- a given interface (also for the system interface). This is required in
-- order to properly delete them from "Manage Data".
if(tags.ifid == nil) then
traceError(TRACE_ERROR, TRACE_CONSOLE, "An 'ifid' tag is required in schema " .. self.name)
return nil
end
return tags, metrics
end