-- -- (C) 2019-20 - ntop.org -- -- https://prometheus.io/ timeseries driver local driver = {} local prometheus_queue = "ntopng.prometheus_export_queue" local max_prometheus_queueLen = 100000 -- ########################### --! @brief Driver constructor. --! @param options global options. --! @return the newly created driver. function driver:new(options) local obj = { } setmetatable(obj, self) self.__index = self return obj end -- ############################################## --! @brief Append a new data point to the timeseries. --! @param schema the schema object. --! @param timestamp the data point timestamp. --! @param tags map tag_name->tag_value. It contains exactly the tags defined in the schema. --! @param metrics map metric_name->metric_value. It contains exactly the metrics defined in the schema. --! @return the true on success, false otherwise. function driver:append(schema, timestamp, tags, metrics) local debug = false if(debug) then print("----- Schema --------------") tprint(schema.name) print("------ Timestamp -------------") tprint(timestamp) print("----- Tags --------------") tprint(tags) print("----- Metrics --------------") tprint(metrics) print("-------------------") end local tags_str = '' for k, v in pairs(tags or {}) do --[[ All