aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/core/stats.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/commands/core/stats.js')
-rw-r--r--server/src/commands/core/stats.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/commands/core/stats.js b/server/src/commands/core/stats.js
index b9dc002..74bd4a5 100644
--- a/server/src/commands/core/stats.js
+++ b/server/src/commands/core/stats.js
@@ -3,6 +3,7 @@
*/
exports.run = async (core, server, socket, data) => {
+ // gather connection and channel count
let ips = {};
let channels = {};
for (let client of server.clients) {
@@ -18,15 +19,17 @@ exports.run = async (core, server, socket, data) => {
ips = null;
channels = null;
+ // dispatch info
server.reply({
cmd: 'info',
text: `${uniqueClientCount} unique IPs in ${uniqueChannels} channels`
}, socket);
+ // stats are fun
core.managers.stats.increment('stats-requested');
};
exports.info = {
name: 'stats',
description: 'Sends back legacy server stats to the calling client'
-}; \ No newline at end of file
+};