Interface: ClientStats
Observability snapshot returned by MllpClient.getStats.
All fields are JSON-serializable, no Buffers, no class instances,
no Maps, no circular references. lastConnectedAt and lastAckAt are
epoch milliseconds (numbers), NOT Date instances, log-pipeline
friendly.
warningsByCode keys are constrained to the public WarningCode
union, adding/removing a code is a breaking change (CLAUDE.md
stable-codes guardrail enforced at the type boundary).
Example
const stats = client.getStats();
logger.info(JSON.stringify(stats));
// {"state":"CONNECTED","connectionId":"…","queueDepth":0, … }
Properties
ackedTotal
readonlyackedTotal:number
Total ACKs matched + resolved since construction.
connectionId
readonlyconnectionId:string|null
Live Connection's id, or null before the first connect (or post-CLOSED).
inFlight
readonlyinFlight:number
Entries with sentAt !== null, actually written to the wire / awaiting ACK.
lastAckAt
readonlylastAckAt:number|null
Epoch ms of the most recent successful ACK. null until first ACK.
lastConnectedAt
readonlylastConnectedAt:number|null
Epoch ms of the last CONNECTED transition. null until first connect.
queueBytes
readonlyqueueBytes:number
Sum of frame.length across live correlator entries.
queueDepth
readonlyqueueDepth:number
Total live correlator entries (in-flight + pre-flush + serialization-queued).
reconnectAttempts
readonlyreconnectAttempts:number
Total reconnect attempts since construction.
sentTotal
readonlysentTotal:number
Total successful connection.send() calls since construction.
state
readonlystate:ConnectionState
Current FSM state, mirrors client.state.
timedOutTotal
readonlytimedOutTotal:number
Total ACK timeouts since construction.
tls
readonlytls:boolean
Whether this client is configured for TLS. Mirrors ClientOptions.tls being set.
totalBytesIn
readonlytotalBytesIn:number
Bytes received from the peer (current Connection).
totalBytesOut
readonlytotalBytesOut:number
Bytes written to the peer (current Connection).
warningsByCode
readonlywarningsByCode:Partial<Record<WarningCode,number>>
Aggregated warning counts. Keys are constrained to the public
WarningCode union. Connection-level warnings + Correlator
MLLP_ACK_* warnings are merged.