From 355e8974a416c1449a8eb1fc76a8253cf976d60f Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Mon, 30 Apr 2018 12:09:01 +0200 Subject: [PATCH] Added more websocket utilization metrics --- .gitignore | 1 + master.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 0270b57f..9752a88d 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ mod_cache.json static/pictures/spritesheet.js static/pictures/spritesheet.png static/external +saves # weird pattern to ignore sharedPlugins except not ignore some core modules !sharedPlugins/ diff --git a/master.js b/master.js index fa47c882..5bece902 100644 --- a/master.js +++ b/master.js @@ -935,6 +935,7 @@ class wsSlave { // handle command return values this.commandsWaitingForReturn = {}; this.socket.on("runCommandReturnValue", resp => { + prometheusWsUsageCounter.labels('runCommandReturnValue').inc(); if(resp.commandID && resp.body && this.commandsWaitingForReturn[resp.commandID] && this.commandsWaitingForReturn[resp.commandID].callback && typeof this.commandsWaitingForReturn[resp.commandID].callback == "function"){ this.commandsWaitingForReturn[resp.commandID].callback(resp.body); delete this.commandsWaitingForReturn[resp.commandID]; @@ -942,6 +943,7 @@ class wsSlave { }); this.socket.on("gameChat", data => { + prometheusWsUsageCounter.labels('gameChat').inc(); if(typeof data === "object"){ data.timestamp = Date.now(); if(!global.wsChatRecievers) global.wsChatRecievers = []; @@ -952,6 +954,7 @@ class wsSlave { }); this.socket.on("alert", alert => { + prometheusWsUsageCounter.labels('alert').inc(); if(typeof alert === "object"){ alert.timestamp = Date.now(); if(!global.wsAlertRecievers) global.wsAlertRecievers = [];