Fix script failures when prometheus export is enabled

This commit is contained in:
emanuele-f 2019-07-25 17:26:47 +02:00
parent 9f494d6126
commit 9c39268441
4 changed files with 22 additions and 15 deletions

View file

@ -24,6 +24,8 @@ function driver:new(options)
return obj
end
-- ##############################################
--! @brief Append a new data point to the timeseries.
--! @param schema the schema object.
--! @param timestamp the data point timestamp.
@ -74,9 +76,10 @@ function driver:append(schema, timestamp, tags, metrics)
ntop.lpushCache(prometheus_queue, metric_str)
ntop.ltrimCache(prometheus_queue, 0, max_prometheus_queueLen)
end
end
-- ##############################################
--! @brief Query timeseries data.
--! @param schema the schema object.
--! @param tstart lower time bound for the query.
@ -128,6 +131,7 @@ end
--! @note a conservative way to implement this is to return the current time.
--! @return most recent timestamp available.
function driver:getLatestTimestamp(ifid)
return os.time()
end
--! @brief Delete timeseries data
@ -136,12 +140,14 @@ end
--! @return true if operation was successful, false otherwise.
--! @note E.g. "iface" schema_prefix matches any schema starting with "iface:". Empty prefix is allowed and matches all the schemas.
function driver:delete(schema_prefix, tags)
return(true)
end
--! @brief Delete old data.
--! @param ifid: the interface ID to process
--! @return true if operation was successful, false otherwise.
function driver:deleteOldData(ifid)
return(true)
end
--! @brief This is called when some driver configuration changes.