Replace endpointHitCounter

Track summary statistic of total HTTP response durations using a
middleware that applies for all requests instead of having every request
needing to update the hit counter manually.  Deprecates
endpointHitCounter.
This commit is contained in:
Hornwitser committed 2023-02-15 20:31:02 +01:00
1 parent 98dc0174d6
commit 5ad89f072f
7 files changed
+23 -24

No files matched your search

-4
View File
@@ -44,8 +44,6 @@ class MasterPlugin extends libPlugin.BaseMasterPlugin {
}, 60e3).unref();
this.master.app.get("/api/player_auth/servers", (req, res) => {
this.metrics.endpointHitCounter.labels(req.route.path).inc();
let servers = [];
for (let instance of this.master.instances.values()) {
if (instance.status === "running" && instance.config.get("player_auth.load_plugin")) {
@@ -56,12 +54,10 @@ class MasterPlugin extends libPlugin.BaseMasterPlugin {
});
this.master.app.post("/api/player_auth/player_code", express.json(), (req, res, next) => {
this.metrics.endpointHitCounter.labels(req.route.path).inc();
this.handlePlayerCode(req, res).catch(next);
});
this.master.app.post("/api/player_auth/verify", express.json(), (req, res, next) => {
this.metrics.endpointHitCounter.labels(req.route.path).inc();
this.handleVerify(req, res).catch(next);
});
}