pub enum ClientEvent {
SessionStarted {
remote: SocketAddr,
token: u64,
negotiated: NegotiatedParams,
at: ClientTimestamp,
},
NoTestCompleted {
remote: SocketAddr,
negotiated: NegotiatedParams,
at: ClientTimestamp,
},
SessionClosed {
remote: SocketAddr,
token: u64,
at: ClientTimestamp,
},
EchoSent {
seq: u32,
remote: SocketAddr,
scheduled_at: Instant,
sent_at: ClientTimestamp,
bytes: usize,
send_call: Duration,
timer_error: Duration,
},
EchoReply {
seq: u32,
remote: SocketAddr,
sent_at: ClientTimestamp,
received_at: ClientTimestamp,
rtt: RttSample,
server_timing: Option<ServerTiming>,
one_way: Option<OneWayDelaySample>,
received_stats: Option<ReceivedStatsSample>,
bytes: usize,
packet_meta: PacketMeta,
},
EchoLoss {
seq: u32,
sent_at: ClientTimestamp,
timeout_at: Instant,
},
DuplicateReply {
seq: u32,
remote: SocketAddr,
received_at: ClientTimestamp,
bytes: usize,
},
LateReply {
seq: u32,
highest_seen: u32,
remote: SocketAddr,
sent_at: Option<ClientTimestamp>,
received_at: ClientTimestamp,
rtt: Option<RttSample>,
server_timing: Option<ServerTiming>,
one_way: Option<OneWayDelaySample>,
received_stats: Option<ReceivedStatsSample>,
bytes: usize,
packet_meta: PacketMeta,
},
Warning {
kind: WarningKind,
message: String,
at: ClientTimestamp,
},
}Expand description
Event emitted by an IRTT client session.
Events form the public lifecycle and measurement stream for callers. UIs
usually display lifecycle, warning, and per-packet events directly; summary
reporting should aggregate EchoSent, EchoReply, EchoLoss,
LateReply, and DuplicateReply events or pass the stream to
irtt-stats.
Variants§
SessionStarted
A normal session has opened and is ready to send echo probes.
Fields
remote: SocketAddrResolved remote socket address.
negotiated: NegotiatedParamsNegotiated protocol parameters for this session.
at: ClientTimestampClient timestamp when the open reply was accepted.
NoTestCompleted
A negotiation-only no-test exchange completed.
No EchoSent, EchoReply, EchoLoss, or SessionClosed events are
expected for this open outcome.
Fields
remote: SocketAddrResolved remote socket address.
negotiated: NegotiatedParamsNegotiated protocol parameters returned by the server.
at: ClientTimestampClient timestamp when the open reply was accepted.
SessionClosed
The session closed locally or through an authenticated peer close.
For a peer close-flagged echo reply, the reply’s measurement or classification event is emitted immediately before this event. Managed sessions disconnect event subscribers after the worker exits, while leaving already queued events available to drain.
Fields
remote: SocketAddrResolved remote socket address.
at: ClientTimestampClient timestamp when the close request was sent.
EchoSent
An echo request was sent.
This records local scheduling and send-call timing. It does not imply a
reply will arrive; callers should pair it with EchoReply, EchoLoss,
LateReply, or DuplicateReply by sequence number when displaying
packet lifecycle state.
Fields
remote: SocketAddrResolved remote socket address.
sent_at: ClientTimestampPaired client wall/monotonic timestamp captured immediately after
the successful UDP send completed. This is the RTT and userspace
upstream one-way-delay fallback endpoint. The operational probe
timeout deadline is computed from an earlier, private, pre-send
timestamp instead — see the client crate’s AGENTS.md.
EchoReply
First in-window reply for a pending echo request.
This is the primary successful measurement event. RTT and optional server timing/statistics fields should generally be aggregated from this variant.
Fields
remote: SocketAddrResolved remote socket address.
sent_at: ClientTimestampClient timestamp recorded immediately after the matching request
finished sending (see ClientEvent::EchoSent::sent_at).
received_at: ClientTimestampClient timestamp recorded when the reply was received.
server_timing: Option<ServerTiming>Optional server-reported timestamps and processing time.
one_way: Option<OneWayDelaySample>Optional one-way delay values derived from client/server wall clocks.
received_stats: Option<ReceivedStatsSample>Optional server-reported received-statistics sample.
packet_meta: PacketMetaReceive-side metadata observed outside the IRTT wire payload.
EchoLoss
A sent echo request exceeded the local probe timeout before a reply was matched.
A later datagram for the same sequence may still arrive and will be
reported as ClientEvent::LateReply rather than changing this event.
Fields
sent_at: ClientTimestampClient timestamp recorded immediately after the request finished
sending (see ClientEvent::EchoSent::sent_at). The timeout
deadline below is anchored to an earlier, private, pre-send
timestamp, not to this one.
DuplicateReply
Additional reply for a sequence that was already completed.
Duplicates are not primary RTT samples. They are useful for diagnostics and packet counters, but should not be aggregated as successful first replies.
Fields
remote: SocketAddrResolved remote socket address.
received_at: ClientTimestampClient timestamp recorded when the duplicate was received.
LateReply
Reply for a sequence that was no longer pending.
This commonly means the probe had already been reported as lost, or the
reply arrived out of the client’s current tracking window. When the
original send metadata is still retained, RTT and one-way timing are
included; otherwise those fields are None.
Fields
remote: SocketAddrResolved remote socket address.
sent_at: Option<ClientTimestamp>Original post-send client timestamp, when still retained (see
ClientEvent::EchoSent::sent_at).
received_at: ClientTimestampClient timestamp recorded when the late reply was received.
server_timing: Option<ServerTiming>Optional server-reported timestamps and processing time.
one_way: Option<OneWayDelaySample>Optional one-way delay values derived from client/server wall clocks.
received_stats: Option<ReceivedStatsSample>Optional server-reported received-statistics sample.
packet_meta: PacketMetaReceive-side metadata observed outside the IRTT wire payload.
Warning
Non-fatal condition observed while receiving or classifying packets.
Warning events are diagnostic. They do not close the session by themselves and are not measurement samples.
Fields
kind: WarningKindMachine-readable warning category.
at: ClientTimestampClient timestamp when the warning was emitted.