Interface: ServerStats
Observability snapshot returned by server.getStats().
All fields are JSON-serializable. connections and activeConnections both
reflect the current live connection count.
Example
const stats = server.getStats();
console.log(JSON.stringify(stats)); // log-pipeline friendly
Properties
acceptedTotal
readonlyacceptedTotal:number
Total connections accepted since listen() (monotonically increasing).
activeConnections
readonlyactiveConnections:number
Current live connection count. Same value as connections.
closedTotal
readonlyclosedTotal:number
Total connections closed since listen() (monotonically increasing).
connections
readonlyconnections:number
Current live connection count.
Same value as activeConnections.
host
readonlyhost:string|null
Bound host, or null before listen().
listening
readonlylistening:boolean
Whether the server is currently accepting connections.
port
readonlyport:number|null
Bound port, or null before listen().
tls
readonlytls:boolean
Whether this server is configured for TLS. Mirrors ServerOptions.tls being set.
tlsClientErrorsTotal
readonlytlsClientErrorsTotal:number
Total 'tlsClientError' events (failed TLS handshakes, incl. rejected client certs) since listen().
totalBytesIn
readonlytotalBytesIn:number
Aggregate bytes received across all current connections.
totalBytesOut
readonlytotalBytesOut:number
Aggregate bytes sent across all current connections.