Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions quinn-proto/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,12 @@ impl Connection {
stats.path.rtt = self.path.rtt.get();
stats.path.cwnd = self.path.congestion.window();
stats.path.current_mtu = self.path.mtud.current_mtu();
stats.path.bytes_in_flight = self.path.in_flight.bytes;
stats.path.packets_in_flight = self.path.in_flight.ack_eliciting;
stats.path.min_rtt = self.path.rtt.min();
stats.path.latest_rtt = self.path.rtt.latest();
stats.path.rtt_variance = self.path.rtt.var();
stats.path.pto_count = self.pto_count;

stats
}
Expand Down
10 changes: 10 additions & 0 deletions quinn-proto/src/connection/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,16 @@ impl RttEstimator {
self.min
}

/// Most recent RTT sample
pub fn latest(&self) -> Duration {
self.latest
}

/// Current RTT variance estimate, computed as described in RFC 6298
pub fn var(&self) -> Duration {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think var is a good name for public API...

self.var
}

// PTO computed as described in RFC9002#6.2.1
pub(crate) fn pto_base(&self) -> Duration {
self.get() + cmp::max(4 * self.var, TIMER_GRANULARITY)
Expand Down
14 changes: 14 additions & 0 deletions quinn-proto/src/connection/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,20 @@ pub struct PathStats {
pub black_holes_detected: u64,
/// Largest UDP payload size the path currently supports
pub current_mtu: u16,
/// Number of bytes considered in-flight by congestion control
///
/// Does not include IP or UDP overhead. Packets containing only ACK frames are excluded.
pub bytes_in_flight: u64,
/// Number of ack-eliciting packets currently in flight
pub packets_in_flight: u64,
/// Minimum RTT observed on this path, ignoring ack delay
pub min_rtt: Duration,
/// Most recently observed RTT sample
pub latest_rtt: Duration,
/// Estimated variance of RTT samples, computed as described in RFC 6298
pub rtt_variance: Duration,
/// Number of probe timeout (PTO) events fired
pub pto_count: u32,
}

/// Connection statistics
Expand Down
Loading