refactor(irtt-stats): remove unknown loss field
This commit is contained in:
2 files changed
+3
-4
No files matched your search
@@ -7,10 +7,8 @@ use crate::PacketCounts;
|
|||||||
/// Directional upstream and downstream loss can be negative when
|
/// Directional upstream and downstream loss can be negative when
|
||||||
/// server-reported counts exceed local expectations.
|
/// server-reported counts exceed local expectations.
|
||||||
pub struct LossStats {
|
pub struct LossStats {
|
||||||
/// Locally inferred lost packets.
|
/// Locally inferred total lost packets.
|
||||||
pub lost_packets: u64,
|
pub lost_packets: u64,
|
||||||
/// Loss not attributed to a direction.
|
|
||||||
pub unknown_loss_packets: u64,
|
|
||||||
/// Server-assisted upstream loss estimate, when server counts are available.
|
/// Server-assisted upstream loss estimate, when server counts are available.
|
||||||
pub upstream_loss_packets: Option<i128>,
|
pub upstream_loss_packets: Option<i128>,
|
||||||
/// Server-assisted downstream loss estimate, when server counts are available.
|
/// Server-assisted downstream loss estimate, when server counts are available.
|
||||||
@@ -67,7 +65,6 @@ pub(crate) fn loss_stats(packets: PacketCounts) -> LossStats {
|
|||||||
|
|
||||||
LossStats {
|
LossStats {
|
||||||
lost_packets: lost,
|
lost_packets: lost,
|
||||||
unknown_loss_packets: lost,
|
|
||||||
upstream_loss_packets,
|
upstream_loss_packets,
|
||||||
downstream_loss_packets,
|
downstream_loss_packets,
|
||||||
packet_loss_percent,
|
packet_loss_percent,
|
||||||
|
|||||||
@@ -264,7 +264,9 @@ fn directional_loss_uses_server_received_count_when_available() {
|
|||||||
collector.process(&reply(0, 10, 10));
|
collector.process(&reply(0, 10, 10));
|
||||||
|
|
||||||
let loss = collector.snapshot().loss;
|
let loss = collector.snapshot().loss;
|
||||||
|
assert_eq!(loss.lost_packets, 1);
|
||||||
assert_eq!(loss.upstream_loss_packets, Some(1));
|
assert_eq!(loss.upstream_loss_packets, Some(1));
|
||||||
assert_eq!(loss.downstream_loss_packets, Some(0));
|
assert_eq!(loss.downstream_loss_packets, Some(0));
|
||||||
|
assert_eq!(loss.packet_loss_percent, 50.0);
|
||||||
assert_eq!(loss.upstream_loss_percent, 50.0);
|
assert_eq!(loss.upstream_loss_percent, 50.0);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user