mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 00:13:12 +09:00
Prometheus track dole factor for imports
This commit is contained in:
1 parent
f07b6160bb
commit
ac55b1c442
1 file changed
+6
@@ -115,6 +115,11 @@ const prometheusImportGauge = new Prometheus.Gauge({
|
|||||||
help: 'Items imported by instance',
|
help: 'Items imported by instance',
|
||||||
labelNames: ["instanceID", "itemName"],
|
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({
|
const prometheusPlayerCountGauge = new Prometheus.Gauge({
|
||||||
name: prometheusPrefix+'player_count_gauge',
|
name: prometheusPrefix+'player_count_gauge',
|
||||||
help: 'Amount of players connected to this cluster',
|
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;
|
sentItemStatisticsBySlaveID[object.instanceID] = sentItemStatistics;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prometheusDoleFactorGauge.labels(object.name).set(_doleDivisionFactor[object.name] || 0);
|
||||||
prometheusImportGauge.labels(object.instanceID, object.name).inc(Number(object.count) || 0);
|
prometheusImportGauge.labels(object.instanceID, object.name).inc(Number(object.count) || 0);
|
||||||
res.send({count: object.count, name: object.name});
|
res.send({count: object.count, name: object.name});
|
||||||
httpRequestDurationMilliseconds.labels(req.route.path).observe(Date.now()-reqStartTime);
|
httpRequestDurationMilliseconds.labels(req.route.path).observe(Date.now()-reqStartTime);
|
||||||
|
|||||||
Reference in new issue
Block a user