Skip to content

Peer stream statistics #5145

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Peer stream statistics #5145

wants to merge 6 commits into from

Conversation

nibanks
Copy link
Collaborator

@nibanks nibanks commented Jun 6, 2025

Description

Fixes #4606 by defining a new extension to exchange and expose peer statistics.

Testing

Locally

Documentation

Some added

@nibanks nibanks added Area: Protocol Updates Changes for new protocol changes Area: API labels Jun 6, 2025
Copy link

github-actions bot commented Jun 6, 2025

Cargo - ubuntu-latest

The rust bindings need to be updated. Please apply (git apply) this patch:

diff --git a/src/rs/ffi/linux_bindings.rs b/src/rs/ffi/linux_bindings.rs
index 283e538..f43e3bf 100644
--- a/src/rs/ffi/linux_bindings.rs
+++ b/src/rs/ffi/linux_bindings.rs
@@ -216,6 +216,7 @@ pub const QUIC_PARAM_STREAM_IDEAL_SEND_BUFFER_SIZE: u32 = 134217730;
 pub const QUIC_PARAM_STREAM_PRIORITY: u32 = 134217731;
 pub const QUIC_PARAM_STREAM_STATISTICS: u32 = 134217732;
 pub const QUIC_PARAM_STREAM_RELIABLE_OFFSET: u32 = 134217733;
+pub const QUIC_PARAM_STREAM_PEER_STATISTICS: u32 = 134217734;
 pub const QUIC_API_VERSION_1: u32 = 1;
 pub const QUIC_API_VERSION_2: u32 = 2;
 pub type BOOLEAN = ::std::os::raw::c_uchar;
@@ -1497,14 +1498,47 @@ impl QUIC_STATISTICS_V2 {
         }
     }
     #[inline]
+    pub fn StreamStatisticsNegotiated(&self) -> u32 {
+        unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
+    }
+    #[inline]
+    pub fn set_StreamStatisticsNegotiated(&mut self, val: u32) {
+        unsafe {
+            let val: u32 = ::std::mem::transmute(val);
+            self._bitfield_1.set(7usize, 1u8, val as u64)
+        }
+    }
+    #[inline]
+    pub unsafe fn StreamStatisticsNegotiated_raw(this: *const Self) -> u32 {
+        unsafe {
+            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
+                ::std::ptr::addr_of!((*this)._bitfield_1),
+                7usize,
+                1u8,
+            ) as u32)
+        }
+    }
+    #[inline]
+    pub unsafe fn set_StreamStatisticsNegotiated_raw(this: *mut Self, val: u32) {
+        unsafe {
+            let val: u32 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                7usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn RESERVED(&self) -> u32 {
-        unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) }
+        unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 24u8) as u32) }
     }
     #[inline]
     pub fn set_RESERVED(&mut self, val: u32) {
         unsafe {
             let val: u32 = ::std::mem::transmute(val);
-            self._bitfield_1.set(7usize, 25u8, val as u64)
+            self._bitfield_1.set(8usize, 24u8, val as u64)
         }
     }
     #[inline]
@@ -1512,8 +1546,8 @@ impl QUIC_STATISTICS_V2 {
         unsafe {
             ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                 ::std::ptr::addr_of!((*this)._bitfield_1),
-                7usize,
-                25u8,
+                8usize,
+                24u8,
             ) as u32)
         }
     }
@@ -1523,8 +1557,8 @@ impl QUIC_STATISTICS_V2 {
             let val: u32 = ::std::mem::transmute(val);
             <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                 ::std::ptr::addr_of_mut!((*this)._bitfield_1),
-                7usize,
-                25u8,
+                8usize,
+                24u8,
                 val as u64,
             )
         }
@@ -1538,6 +1572,7 @@ impl QUIC_STATISTICS_V2 {
         GreaseBitNegotiated: u32,
         EcnCapable: u32,
         EncryptionOffloaded: u32,
+        StreamStatisticsNegotiated: u32,
         RESERVED: u32,
     ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
@@ -1569,7 +1604,12 @@ impl QUIC_STATISTICS_V2 {
             let EncryptionOffloaded: u32 = unsafe { ::std::mem::transmute(EncryptionOffloaded) };
             EncryptionOffloaded as u64
         });
-        __bindgen_bitfield_unit.set(7usize, 25u8, {
+        __bindgen_bitfield_unit.set(7usize, 1u8, {
+            let StreamStatisticsNegotiated: u32 =
+                unsafe { ::std::mem::transmute(StreamStatisticsNegotiated) };
+            StreamStatisticsNegotiated as u64
+        });
+        __bindgen_bitfield_unit.set(8usize, 24u8, {
             let RESERVED: u32 = unsafe { ::std::mem::transmute(RESERVED) };
             RESERVED as u64
         });

Copy link

github-actions bot commented Jun 6, 2025

Cargo - windows-latest

The rust bindings need to be updated. Please apply (git apply) this patch:

diff --git a/src/rs/ffi/win_bindings.rs b/src/rs/ffi/win_bindings.rs
index c2af262..5c1c565 100644
--- a/src/rs/ffi/win_bindings.rs
+++ b/src/rs/ffi/win_bindings.rs
@@ -213,6 +213,7 @@ pub const QUIC_PARAM_STREAM_IDEAL_SEND_BUFFER_SIZE: u32 = 134217730;
 pub const QUIC_PARAM_STREAM_PRIORITY: u32 = 134217731;
 pub const QUIC_PARAM_STREAM_STATISTICS: u32 = 134217732;
 pub const QUIC_PARAM_STREAM_RELIABLE_OFFSET: u32 = 134217733;
+pub const QUIC_PARAM_STREAM_PEER_STATISTICS: u32 = 134217734;
 pub const QUIC_API_VERSION_1: u32 = 1;
 pub const QUIC_API_VERSION_2: u32 = 2;
 pub type BYTE = ::std::os::raw::c_uchar;
@@ -1491,14 +1492,47 @@ impl QUIC_STATISTICS_V2 {
         }
     }
     #[inline]
+    pub fn StreamStatisticsNegotiated(&self) -> u32 {
+        unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
+    }
+    #[inline]
+    pub fn set_StreamStatisticsNegotiated(&mut self, val: u32) {
+        unsafe {
+            let val: u32 = ::std::mem::transmute(val);
+            self._bitfield_1.set(7usize, 1u8, val as u64)
+        }
+    }
+    #[inline]
+    pub unsafe fn StreamStatisticsNegotiated_raw(this: *const Self) -> u32 {
+        unsafe {
+            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
+                ::std::ptr::addr_of!((*this)._bitfield_1),
+                7usize,
+                1u8,
+            ) as u32)
+        }
+    }
+    #[inline]
+    pub unsafe fn set_StreamStatisticsNegotiated_raw(this: *mut Self, val: u32) {
+        unsafe {
+            let val: u32 = ::std::mem::transmute(val);
+            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
+                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
+                7usize,
+                1u8,
+                val as u64,
+            )
+        }
+    }
+    #[inline]
     pub fn RESERVED(&self) -> u32 {
-        unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) }
+        unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 24u8) as u32) }
     }
     #[inline]
     pub fn set_RESERVED(&mut self, val: u32) {
         unsafe {
             let val: u32 = ::std::mem::transmute(val);
-            self._bitfield_1.set(7usize, 25u8, val as u64)
+            self._bitfield_1.set(8usize, 24u8, val as u64)
         }
     }
     #[inline]
@@ -1506,8 +1540,8 @@ impl QUIC_STATISTICS_V2 {
         unsafe {
             ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                 ::std::ptr::addr_of!((*this)._bitfield_1),
-                7usize,
-                25u8,
+                8usize,
+                24u8,
             ) as u32)
         }
     }
@@ -1517,8 +1551,8 @@ impl QUIC_STATISTICS_V2 {
             let val: u32 = ::std::mem::transmute(val);
             <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                 ::std::ptr::addr_of_mut!((*this)._bitfield_1),
-                7usize,
-                25u8,
+                8usize,
+                24u8,
                 val as u64,
             )
         }
@@ -1532,6 +1566,7 @@ impl QUIC_STATISTICS_V2 {
         GreaseBitNegotiated: u32,
         EcnCapable: u32,
         EncryptionOffloaded: u32,
+        StreamStatisticsNegotiated: u32,
         RESERVED: u32,
     ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
@@ -1563,7 +1598,12 @@ impl QUIC_STATISTICS_V2 {
             let EncryptionOffloaded: u32 = unsafe { ::std::mem::transmute(EncryptionOffloaded) };
             EncryptionOffloaded as u64
         });
-        __bindgen_bitfield_unit.set(7usize, 25u8, {
+        __bindgen_bitfield_unit.set(7usize, 1u8, {
+            let StreamStatisticsNegotiated: u32 =
+                unsafe { ::std::mem::transmute(StreamStatisticsNegotiated) };
+            StreamStatisticsNegotiated as u64
+        });
+        __bindgen_bitfield_unit.set(8usize, 24u8, {
             let RESERVED: u32 = unsafe { ::std::mem::transmute(RESERVED) };
             RESERVED as u64
         });

Copy link

codecov bot commented Jun 6, 2025

Codecov Report

Attention: Patch coverage is 77.19298% with 26 lines in your changes missing coverage. Please review.

Project coverage is 67.46%. Comparing base (0298f93) to head (05b4e33).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
src/core/stream.c 63.04% 17 Missing ⚠️
src/core/frame.c 85.71% 4 Missing ⚠️
src/core/crypto_tls.c 81.81% 2 Missing ⚠️
src/core/connection.c 0.00% 1 Missing ⚠️
src/core/stream_recv.c 90.00% 1 Missing ⚠️
src/core/stream_send.c 94.11% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5145       +/-   ##
===========================================
- Coverage   87.10%   67.46%   -19.65%     
===========================================
  Files          59       59               
  Lines       18035    18134       +99     
===========================================
- Hits        15710    12234     -3476     
- Misses       2325     5900     +3575     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: API Area: Protocol Updates Changes for new protocol changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Peer Stream Statistics Extension
1 participant