refactor(client): use SignedDuration for one-way delay to support negative values

Allow one-way delay samples to represent negative values caused by wall-clock skew between client and server. Update CLI output and statistics collection to correctly handle and report these signed durations.
This commit is contained in:
Nils Andreas Svee committed 2026-05-17 23:55:01 +07:00
1 parent 0b16ee802d
commit 3b5336a487
7 files changed
+193 -19

No files matched your search

+2 -2
View File
@@ -72,8 +72,8 @@ fn reply_with_rtt(seq: u32, raw_ms: u64, rtt: RttSample) -> ClientEvent {
processing: Some(Duration::from_millis(1)),
}),
one_way: Some(OneWayDelaySample {
client_to_server: Some(Duration::from_millis(1)),
server_to_client: Some(Duration::from_millis(2)),
client_to_server: Some(SignedDuration::from_nanos(1_000_000)),
server_to_client: Some(SignedDuration::from_nanos(2_000_000)),
}),
received_stats: Some(ReceivedStatsSample {
count: Some(seq + 1),