Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose min_rtt and rttvar to FFI #1866

Merged
merged 2 commits into from
Oct 30, 2024
Merged
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 quiche/include/quiche.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,12 @@ typedef struct {
// The estimated round-trip time of the path (in nanoseconds).
uint64_t rtt;

// The minimum round-trip time observed (in nanoseconds).
uint64_t min_rtt;

// The estimated round-trip time variation (in nanoseconds).
uint64_t rttvar;

// The size of the path's congestion window in bytes.
size_t cwnd;

Expand Down
4 changes: 4 additions & 0 deletions quiche/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,8 @@ pub struct PathStats {
lost: usize,
retrans: usize,
rtt: u64,
min_rtt: u64,
rttvar: u64,
cwnd: usize,
sent_bytes: u64,
recv_bytes: u64,
Expand Down Expand Up @@ -1328,6 +1330,8 @@ pub extern fn quiche_conn_path_stats(
out.lost = stats.lost;
out.retrans = stats.retrans;
out.rtt = stats.rtt.as_nanos() as u64;
out.min_rtt = stats.min_rtt.unwrap_or_default().as_nanos() as u64;
out.rttvar = stats.rttvar.as_nanos() as u64;
out.cwnd = stats.cwnd;
out.sent_bytes = stats.sent_bytes;
out.recv_bytes = stats.recv_bytes;
Expand Down