diff --git a/moonraker/components/proc_stats.py b/moonraker/components/proc_stats.py index 785a85b..0f12966 100644 --- a/moonraker/components/proc_stats.py +++ b/moonraker/components/proc_stats.py @@ -94,11 +94,13 @@ class ProcStats: ts = await self._check_throttled_state() cpu_temp = await self.event_loop.run_in_thread( self._get_cpu_temperature) + websocket_count = self.server.get_websocket_manager().get_count() return { 'moonraker_stats': list(self.proc_stat_queue), 'throttled_state': ts, 'cpu_temp': cpu_temp, - 'network': self.last_net_stats + 'network': self.last_net_stats, + 'websocket_connections': websocket_count } async def _handle_shutdown(self) -> None: @@ -137,10 +139,12 @@ class ProcStats: 'mem_units': mem_units } self.proc_stat_queue.append(result) + websocket_count = self.server.get_websocket_manager().get_count() self.server.send_event("proc_stats:proc_stat_update", { 'moonraker_stats': result, 'cpu_temp': cpu_temp, - 'network': net + 'network': net, + 'websocket_connections': websocket_count }) self.last_update_time = update_time self.last_proc_time = proc_time