docs(stats): clarify server receive-window semantics
An audit of the server-reported receive window found no defect in the statistics pipeline: the bitmap is decoded raw, stored raw, never interpreted, and never feeds the directional loss estimates, which use the cumulative server receive count. The public rustdoc was silent on all of that, leaving consumers of PacketCounts free to read a window of 0x1 as a 63-packet loss burst. Document the field's contract, name the count as the only server input to LossStats, and cover the window-only case with a regression test.
This commit is contained in:
5 files changed
+67
-3
No files matched your search
@@ -6,6 +6,11 @@ use crate::PacketCounts;
|
||||
/// Percentage fields are percentages from `0.0` to `100.0` in normal cases.
|
||||
/// Directional upstream and downstream loss can be negative when
|
||||
/// server-reported counts exceed local expectations.
|
||||
///
|
||||
/// The directional fields are derived from
|
||||
/// [`PacketCounts::server_packets_received`] and are `None` when the server
|
||||
/// reported no receive count. [`PacketCounts::server_received_window`] is never
|
||||
/// used to derive loss.
|
||||
pub struct LossStats {
|
||||
/// Locally inferred total lost packets.
|
||||
pub lost_packets: u64,
|
||||
|
||||
Reference in new issue
Block a user