Skip to content

Commit 40e215c

Browse files
wang178ccopybara-github
authored andcommitted
Replace size_t with uint32_t in QuicConnectionStats.
Also removes unused tlp_count. This saves 96 bytes per connection. PiperOrigin-RevId: 859724638
1 parent 8f36373 commit 40e215c

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

quiche/quic/core/quic_connection_stats.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ std::ostream& operator<<(std::ostream& os, const QuicConnectionStats& s) {
3232
<< s.undecryptable_packets_received_before_handshake_complete;
3333
os << " crypto_retransmit_count: " << s.crypto_retransmit_count;
3434
os << " loss_timeout_count: " << s.loss_timeout_count;
35-
os << " tlp_count: " << s.tlp_count;
3635
os << " pto_count: " << s.pto_count;
3736
os << " min_rtt_us: " << s.min_rtt_us;
3837
os << " srtt_us: " << s.srtt_us;

quiche/quic/core/quic_connection_stats.h

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,11 @@ struct QUICHE_EXPORT QuicConnectionStats {
9797
// before the handshake was complete.
9898
QuicPacketCount undecryptable_packets_received_before_handshake_complete = 0;
9999

100-
size_t crypto_retransmit_count = 0;
100+
uint32_t crypto_retransmit_count = 0;
101101
// Count of times the loss detection alarm fired. At least one packet should
102102
// be lost when the alarm fires.
103-
size_t loss_timeout_count = 0;
104-
size_t tlp_count = 0;
105-
size_t pto_count = 0;
103+
uint32_t loss_timeout_count = 0;
104+
uint32_t pto_count = 0;
106105

107106
int64_t min_rtt_us = 0; // Minimum RTT in microseconds.
108107
int64_t srtt_us = 0; // Smoothed RTT in microseconds.
@@ -142,14 +141,14 @@ struct QUICHE_EXPORT QuicConnectionStats {
142141
// Handshake completion time.
143142
QuicTime handshake_completion_time = QuicTime::Zero();
144143

145-
uint64_t blocked_frames_received = 0;
146-
uint64_t blocked_frames_sent = 0;
144+
uint32_t blocked_frames_received = 0;
145+
uint32_t blocked_frames_sent = 0;
147146

148147
// Number of connectivity probing packets received by this connection.
149-
uint64_t num_connectivity_probing_received = 0;
148+
uint32_t num_connectivity_probing_received = 0;
150149

151150
// Number of PATH_RESPONSE frame received by this connection.
152-
uint64_t num_path_response_received = 0;
151+
uint32_t num_path_response_received = 0;
153152

154153
// Whether a RETRY packet was successfully processed.
155154
bool retry_packet_processed = false;
@@ -173,11 +172,11 @@ struct QUICHE_EXPORT QuicConnectionStats {
173172
QuicPacketNumber first_decrypted_packet;
174173

175174
// Max consecutive retransmission timeout before making forward progress.
176-
size_t max_consecutive_rto_with_forward_progress = 0;
175+
uint32_t max_consecutive_rto_with_forward_progress = 0;
177176

178177
// Number of times when the connection tries to send data but gets throttled
179178
// by amplification factor.
180-
size_t num_amplification_throttling = 0;
179+
uint32_t num_amplification_throttling = 0;
181180

182181
// Number of key phase updates that have occurred. In the case of a locally
183182
// initiated key update, this is incremented when the keys are updated, before
@@ -208,42 +207,42 @@ struct QUICHE_EXPORT QuicConnectionStats {
208207
// packet.
209208
bool address_validated_via_token = false;
210209

211-
size_t ping_frames_sent = 0;
210+
uint32_t ping_frames_sent = 0;
212211

213212
// Number of detected peer address changes which changes to a peer address
214213
// validated by earlier path validation.
215-
size_t num_peer_migration_to_proactively_validated_address = 0;
214+
uint32_t num_peer_migration_to_proactively_validated_address = 0;
216215
// Number of detected peer address changes which triggers reverse path
217216
// validation.
218-
size_t num_reverse_path_validtion_upon_migration = 0;
217+
uint32_t num_reverse_path_validtion_upon_migration = 0;
219218
// Number of detected peer migrations which either succeed reverse path
220219
// validation or no need to be validated.
221-
size_t num_validated_peer_migration = 0;
220+
uint32_t num_validated_peer_migration = 0;
222221
// Number of detected peer migrations which triggered reverse path validation
223222
// and failed and fell back to the old path.
224-
size_t num_invalid_peer_migration = 0;
223+
uint32_t num_invalid_peer_migration = 0;
225224
// Number of detected peer migrations which triggered reverse path validation
226225
// which was canceled because the peer migrated again. Such migration is also
227226
// counted as invalid peer migration.
228-
size_t num_peer_migration_while_validating_default_path = 0;
227+
uint32_t num_peer_migration_while_validating_default_path = 0;
229228
// Number of NEW_CONNECTION_ID frames sent.
230-
size_t num_new_connection_id_sent = 0;
229+
uint32_t num_new_connection_id_sent = 0;
231230
// Number of RETIRE_CONNECTION_ID frames sent.
232-
size_t num_retire_connection_id_sent = 0;
231+
uint32_t num_retire_connection_id_sent = 0;
233232
// Number of path degrading.
234-
size_t num_path_degrading = 0;
233+
uint32_t num_path_degrading = 0;
235234
// Number of forward progress made after path degrading.
236-
size_t num_forward_progress_after_path_degrading = 0;
235+
uint32_t num_forward_progress_after_path_degrading = 0;
237236
// Number of path degrading.
238-
size_t num_flow_label_changes = 0;
237+
uint32_t num_flow_label_changes = 0;
239238
// Number of forward progress made after aflow label change.
240-
size_t num_forward_progress_after_flow_label_change = 0;
239+
uint32_t num_forward_progress_after_flow_label_change = 0;
241240

242241
bool server_preferred_address_validated = false;
243242
bool failed_to_validate_server_preferred_address = false;
244243
// Number of duplicated packets that have been sent to server preferred
245244
// address while the validation is pending.
246-
size_t num_duplicated_packets_sent_to_server_preferred_address = 0;
245+
uint32_t num_duplicated_packets_sent_to_server_preferred_address = 0;
247246

248247
struct QUICHE_EXPORT TlsServerOperationStats {
249248
bool success = false;
@@ -261,7 +260,7 @@ struct QUICHE_EXPORT QuicConnectionStats {
261260
std::optional<TlsServerOperationStats> tls_server_decrypt_ticket_stats;
262261

263262
// The total number of streams which were pending from some time.
264-
size_t num_total_pending_streams = 0;
263+
uint32_t num_total_pending_streams = 0;
265264

266265
// Statistics to measure how many client path probes are reset.
267266
uint32_t num_client_probing_attempts = 0;

0 commit comments

Comments
 (0)