WebSocket Connections

Statistics

Total Connections
{{ stats.total_active + stats.total_closed }}
Messages Sent
{{ stats.total_messages_sent }}
Messages Received
{{ stats.total_messages_received }}
Data Sent
{% if stats.total_bytes_sent >= 1048576 %} {{ "%.2f"|format(stats.total_bytes_sent / 1048576) }} MB {% elif stats.total_bytes_sent >= 1024 %} {{ "%.2f"|format(stats.total_bytes_sent / 1024) }} KB {% else %} {{ stats.total_bytes_sent }} B {% endif %}
Data Received
{% if stats.total_bytes_received >= 1048576 %} {{ "%.2f"|format(stats.total_bytes_received / 1048576) }} MB {% elif stats.total_bytes_received >= 1024 %} {{ "%.2f"|format(stats.total_bytes_received / 1024) }} KB {% else %} {{ stats.total_bytes_received }} B {% endif %}
{% if stats.active_connections %}

Active Connections {{ stats.active_connections|length }}

{% for conn in stats.active_connections %} {% endfor %}
Status Connection ID Path Duration Messages Data Transfer
{{ conn.state }} {{ conn.short_id }}
{{ conn.path }}
{% if conn.query_string %}
?{{ conn.query_string }}
{% endif %}
{% set duration_seconds = conn.duration %} {% if duration_seconds >= 3600 %} {{ "%dh %dm"|format(duration_seconds // 3600, (duration_seconds % 3600) // 60) }} {% elif duration_seconds >= 60 %} {{ "%dm %ds"|format(duration_seconds // 60, duration_seconds % 60) }} {% else %} {{ "%.1fs"|format(duration_seconds) }} {% endif %} ↑ {{ conn.total_sent }} ↓ {{ conn.total_received }} {% set total_bytes = conn.bytes_sent + conn.bytes_received %} {% if total_bytes >= 1048576 %} {{ "%.2f MB"|format(total_bytes / 1048576) }} {% elif total_bytes >= 1024 %} {{ "%.2f KB"|format(total_bytes / 1024) }} {% else %} {{ total_bytes }} B {% endif %}
{% endif %} {% if stats.active_connections or stats.closed_connections %} {% set all_messages = [] %} {% for conn in stats.active_connections %} {% for msg in conn.messages %} {% set _ = all_messages.append(msg) %} {% endfor %} {% endfor %} {% for conn in stats.closed_connections %} {% for msg in conn.messages %} {% set _ = all_messages.append(msg) %} {% endfor %} {% endfor %} {% if all_messages %}

Recent Messages Last {{ [all_messages|length, 20]|min }}

{% for message in all_messages[-20:] %}
{% if message.direction == 'sent' %} → {% else %} ← {% endif %}
{% if message.direction == 'sent' %} Sent {% else %} Received {% endif %} {{ message.timestamp }} Type: {{ message.type }} Size: {% if message.size >= 1024 %} {{ "%.2f KB"|format(message.size / 1024) }} {% else %} {{ message.size }} B {% endif %}
{{ message.preview }}
{% if message.truncated %}
⚠ Message content truncated
{% endif %}
{% endfor %}
{% endif %} {% endif %} {% if stats.closed_connections %}

Closed Connections {{ stats.closed_connections|length }}

{% for conn in stats.closed_connections %} {% endfor %}
Status Connection ID Path Duration Messages Close Info
{{ conn.state }} {{ conn.short_id }}
{{ conn.path }}
{% if conn.query_string %}
?{{ conn.query_string }}
{% endif %}
{% if conn.duration %} {% set duration_seconds = conn.duration %} {% if duration_seconds >= 3600 %} {{ "%dh %dm"|format(duration_seconds // 3600, (duration_seconds % 3600) // 60) }} {% elif duration_seconds >= 60 %} {{ "%dm %ds"|format(duration_seconds // 60, duration_seconds % 60) }} {% else %} {{ "%.1fs"|format(duration_seconds) }} {% endif %} {% else %} - {% endif %} ↑ {{ conn.total_sent }} ↓ {{ conn.total_received }} {% if conn.messages_dropped > 0 %} ({{ conn.messages_dropped }} dropped) {% endif %} {% if conn.close_code %}
{{ conn.close_code }} {% if conn.close_reason %} {{ conn.close_reason }} {% endif %}
{% else %} Normal closure {% endif %}
{% endif %} {% if not stats.active_connections and not stats.closed_connections %}
🔌

No WebSocket connections detected in this request

{% endif %}