diff --git a/src/counters.js b/src/counters.js index 473e50af..a708cfa6 100644 --- a/src/counters.js +++ b/src/counters.js @@ -29,3 +29,6 @@ function getConnectedSockets() { const reporter = new JSONFileMetricsReporter('counters.log'); Metrics.setReporter(reporter); Metrics.setReportInterval(60000); +Metrics.addReportHook((metrics) => { + metrics.incCounter('socket.io:count', getConnectedSockets()); +});