Use schema name in timeseries API

This commit is contained in:
emanuele-f 2018-06-27 17:18:23 +02:00
parent 39a7375727
commit 5d50622341
9 changed files with 86 additions and 108 deletions

View file

@ -3,8 +3,6 @@
--
local ts_utils = require "ts_utils"
local ts_schemas = {}
local schema
-- ##############################################
@ -12,29 +10,21 @@ local schema
schema = ts_utils.newSchema("iface:traffic", {step=1, rrd_fname="bytes"})
schema:addTag("ifid")
schema:addMetric("bytes", ts_utils.metrics.counter)
ts_schemas.iface_traffic = schema
-- ##############################################
schema = ts_utils.newSchema("iface:packets", {step=1, rrd_fname="packets"})
schema:addTag("ifid")
schema:addMetric("packets", ts_utils.metrics.counter)
ts_schemas.iface_packets = schema
-- ##############################################
schema = ts_utils.newSchema("iface:zmq_recv_flows", {step=1, rrd_fname="num_zmq_rcvd_flows"})
schema:addTag("ifid")
schema:addMetric("num_flows", ts_utils.metrics.gauge)
ts_schemas.iface_zmq_recv_flows = schema
-- ##############################################
schema = ts_utils.newSchema("iface:drops", {step=1, rrd_fname="drops"})
schema:addTag("ifid")
schema:addMetric("packets", ts_utils.metrics.counter)
ts_schemas.iface_drops = schema
-- ##############################################
return ts_schemas