Skip to main content

Interface: ClientStatistics

Client connection statistics.

Properties

channelId

channelId: string

Channel identifier in use.


connectCount

connectCount: number

Number of successful connections in this client lifetime.


connectionAttemptCount

connectionAttemptCount: number

Number of consecutive attempts since last success (resets on connect).


connectionState

connectionState: ConnectionState

Current connection state.


connectionSuccessRatio

connectionSuccessRatio: number

Ratio of successful connections to total attempts (0–1).


packetsLost?

optional packetsLost: number

Cumulative WebTransport packets lost this session; undefined on WS/unsupported.


packetsSent?

optional packetsSent: number

Cumulative WebTransport packets sent this session; undefined on WS/unsupported.


reconnectsPerHour

reconnectsPerHour: number

Average reconnections per hour since client creation.


rtt?

optional rtt: number

Server-reported RTT (ms); undefined until the first stats object.


timeConnected

timeConnected: number

Time in ms the current connection has been up (0 if disconnected).


totalConnectionAttempts

totalConnectionAttempts: number

Total connection attempts in this client lifetime.


transportSelectionReason?

optional transportSelectionReason: TransportSelectionReason

Why the current transport was chosen; set on fallback (e.g. WebSocket).


transportType?

optional transportType: string

Transport for the session (WebTransport/WebSocket).


uptime

uptime: number

Time in ms since client was created.


url

url: string

MoQ Server URL used for the current/last session.