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:
1 parent
37de7c96a1
commit
bec56d4114
14 files changed
+207
-86
No files matched your search
@@ -426,9 +426,7 @@ mod tests {
|
||||
rtt: RttSample {
|
||||
raw: Duration::from_micros(rtt_us),
|
||||
adjusted: None,
|
||||
effective: Duration::from_micros(rtt_us),
|
||||
adjusted_signed: None,
|
||||
effective_signed: SignedDuration {
|
||||
effective: SignedDuration {
|
||||
ns: i128::from(rtt_us) * 1_000,
|
||||
},
|
||||
},
|
||||
@@ -468,9 +466,7 @@ mod tests {
|
||||
rtt: RttSample {
|
||||
raw: Duration::from_micros(1200),
|
||||
adjusted: None,
|
||||
effective: Duration::from_micros(1200),
|
||||
adjusted_signed: None,
|
||||
effective_signed: SignedDuration { ns: 1_200_000 },
|
||||
effective: SignedDuration { ns: 1_200_000 },
|
||||
},
|
||||
server_timing: None,
|
||||
one_way: None,
|
||||
@@ -583,9 +579,7 @@ mod tests {
|
||||
rtt: RttSample {
|
||||
raw: Duration::from_micros(1),
|
||||
adjusted: None,
|
||||
effective: Duration::from_micros(1),
|
||||
adjusted_signed: None,
|
||||
effective_signed: SignedDuration { ns: 1_000 },
|
||||
effective: SignedDuration { ns: 1_000 },
|
||||
},
|
||||
server_timing: None,
|
||||
one_way: None,
|
||||
|
||||
Reference in new issue
Block a user