refactor(client): use SignedDuration for effective RTT to support negative values

Simplify RttSample by merging signed and unsigned fields into a single SignedDuration for adjusted and effective RTT. This ensures accurate reporting and statistics when server processing time exceeds raw RTT.
This commit is contained in:
Nils Andreas Svee committed 2026-05-17 21:30:51 +07:00
1 parent 37de7c96a1
commit bec56d4114
14 files changed
+207 -86

No files matched your search

+15 -5
View File
@@ -198,6 +198,9 @@ pub struct EventCounts {
/// Warning events processed.
pub warning_events: u64,
/// Late replies that could not be matched to retained in-flight state.
///
/// These replies are observed on the socket, but cannot contribute RTT,
/// one-way delay, server-processing, or IPDV samples.
pub untracked_late_replies: u64,
}
@@ -206,19 +209,26 @@ pub struct EventCounts {
pub struct PacketCounts {
/// Probe packets sent by the local client.
pub packets_sent: u64,
/// Reply packets received by the local client, including duplicates and late packets.
/// Reply packets observed by the local client.
///
/// This includes unique measurable replies, duplicate replies, and late
/// replies that cannot be matched to retained in-flight state.
pub packets_received: u64,
/// Unique replies received by the local client.
/// Unique replies that can contribute timing measurements.
pub unique_replies: u64,
/// Duplicate replies received by the local client.
pub duplicates: u64,
/// Late reply packets received by the local client.
/// Late reply packets received by the local client, including untracked-late replies.
pub late_packets: u64,
/// Probe bytes sent by the local client.
pub bytes_sent: u64,
/// Reply bytes received by the local client.
/// Reply bytes observed by the local client.
///
/// This includes bytes from unique measurable replies, duplicate replies,
/// and untracked-late replies. Per-category byte counts are not currently
/// exposed separately.
pub bytes_received: u64,
/// Server-reported packets received, when available.
/// Highest cumulative server-reported packets received, when available.
pub server_packets_received: Option<u64>,
/// Server-reported receive window, when available.
pub server_received_window: Option<u64>,