Skip to content

Added RttVariance to connection statistics. #5070

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

Merged
merged 4 commits into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions scripts/generate-dotnet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ $Arguments = @(
"-e QUIC_STATISTICS_V2_SIZE_1" # Inconsistent definitions across platforms
"-e QUIC_STATISTICS_V2_SIZE_2" # Inconsistent definitions across platforms
"-e QUIC_STATISTICS_V2_SIZE_3" # Inconsistent definitions across platforms
"-e QUIC_STATISTICS_V2_SIZE_4" # Inconsistent definitions across platforms
)

$FullArgs = $Arguments -join " "
Expand Down
4 changes: 3 additions & 1 deletion src/core/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -6871,10 +6871,12 @@ QuicConnGetV2Statistics(
if (STATISTICS_HAS_FIELD(*StatsLength, SendEcnCongestionCount)) {
Stats->SendEcnCongestionCount = Connection->Stats.Send.EcnCongestionCount;
}

if (STATISTICS_HAS_FIELD(*StatsLength, HandshakeHopLimitTTL)) {
Stats->HandshakeHopLimitTTL = Connection->Stats.Handshake.HandshakeHopLimitTTL;
}
if (STATISTICS_HAS_FIELD(*StatsLength, RttVariance)) {
Stats->RttVariance = (uint32_t)Path->RttVariance;
}

*StatsLength = CXPLAT_MIN(*StatsLength, sizeof(QUIC_STATISTICS_V2));

Expand Down
3 changes: 3 additions & 0 deletions src/cs/lib/msquic_generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,9 @@ internal uint RESERVED

[NativeTypeName("uint8_t")]
internal byte HandshakeHopLimitTTL;

[NativeTypeName("uint32_t")]
internal uint RttVariance;
}

internal partial struct QUIC_LISTENER_STATISTICS
Expand Down
3 changes: 3 additions & 0 deletions src/inc/msquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,8 @@ typedef struct QUIC_STATISTICS_V2 {

uint8_t HandshakeHopLimitTTL; // The TTL value in the initial packet of the handshake.

uint32_t RttVariance; // In microseconds

// N.B. New fields must be appended to end

} QUIC_STATISTICS_V2;
Expand All @@ -591,6 +593,7 @@ typedef struct QUIC_STATISTICS_V2 {
#define QUIC_STATISTICS_V2_SIZE_1 QUIC_STRUCT_SIZE_THRU_FIELD(QUIC_STATISTICS_V2, KeyUpdateCount) // v2.0 final size
#define QUIC_STATISTICS_V2_SIZE_2 QUIC_STRUCT_SIZE_THRU_FIELD(QUIC_STATISTICS_V2, DestCidUpdateCount) // v2.1 final size
#define QUIC_STATISTICS_V2_SIZE_3 QUIC_STRUCT_SIZE_THRU_FIELD(QUIC_STATISTICS_V2, SendEcnCongestionCount) // v2.2 final size
#define QUIC_STATISTICS_V2_SIZE_4 QUIC_STRUCT_SIZE_THRU_FIELD(QUIC_STATISTICS_V2, RttVariance) // v2.5 final size

typedef struct QUIC_LISTENER_STATISTICS {

Expand Down