Skip to content

Commit

Permalink
ffi: expose min_rtt and rttvar to FFI
Browse files Browse the repository at this point in the history
  • Loading branch information
LPardue authored Oct 30, 2024
1 parent 88c9f2a commit 57bdafd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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

0 comments on commit 57bdafd

Please sign in to comment.