Skip to main content
Version: v0.0.3

Interface: ConnectionStats

Return type of connection.getStats(), JSON-serializable.

All timestamps are Date | null (not epoch milliseconds). JSON.stringify() serialises them to ISO 8601 strings by default with no information loss.

Example

const stats = conn.getStats();
logger.info(JSON.stringify(stats)); // safe: all values are JSON-serializable

Properties

bytesIn

readonly bytesIn: number


bytesOut

readonly bytesOut: number


connectedAt

readonly connectedAt: Date | null


connectionId

readonly connectionId: string


lastByteInAt

readonly lastByteInAt: Date | null


lastByteOutAt

readonly lastByteOutAt: Date | null


remoteAddress

readonly remoteAddress: string | null


remotePort

readonly remotePort: number | null


state

readonly state: ConnectionState


warningsByCode

readonly warningsByCode: Record<string, number>


warningsTruncated

readonly warningsTruncated: boolean