getStats method

StompServiceStats getStats()

Gets statistics about the STOMP service

Implementation

StompServiceStats getStats() {
  final connectedClients = _clients.values.where((c) => c.isConnected).length;
  final serverConnections = _server?.connections.length ?? 0;

  return StompServiceStats(
    isStarted: _isStarted,
    serverEnabled: _options.enableServer,
    serverRunning: _server?.isRunning ?? false,
    connectedClients: connectedClients,
    totalClients: _clients.length,
    serverConnections: serverConnections,
  );
}