From ac55b1c442d4898dcc202f40b14b50fea729894e Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Sun, 6 May 2018 20:45:52 +0200 Subject: [PATCH] Prometheus track dole factor for imports --- master.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/master.js b/master.js index f67a4c6e..6ca8f282 100644 --- a/master.js +++ b/master.js @@ -115,6 +115,11 @@ const prometheusImportGauge = new Prometheus.Gauge({ help: 'Items imported by instance', labelNames: ["instanceID", "itemName"], }); +const prometheusDoleFactorGauge = new Prometheus.Gauge({ + name: prometheusPrefix+'dole_factor_gauge', + help: 'The current dole division factor for this item', + labelNames: ["itemName"], +}); const prometheusPlayerCountGauge = new Prometheus.Gauge({ name: prometheusPrefix+'player_count_gauge', help: 'Amount of players connected to this cluster', @@ -535,6 +540,7 @@ app.post("/api/remove", authenticate.middleware, function(req, res) { sentItemStatisticsBySlaveID[object.instanceID] = sentItemStatistics; } + prometheusDoleFactorGauge.labels(object.name).set(_doleDivisionFactor[object.name] || 0); prometheusImportGauge.labels(object.instanceID, object.name).inc(Number(object.count) || 0); res.send({count: object.count, name: object.name}); httpRequestDurationMilliseconds.labels(req.route.path).observe(Date.now()-reqStartTime);