Bug 1929818 - add Glean metric for QUIC frame count r=kershaw,necko-reviewers

Add a Glean metric counting the number of QUIC frames, labeled by frame type.

This is e.g. helpful to measure the impact of [stream receive window
auto-tuning](https://github.com/mozilla/neqo/issues/733), looking at the number
of max_stream_data frames sent and stream_data_blocked frames received.

Differential Revision: https://phabricator.services.mozilla.com/D228295
This commit is contained in:
Max Inden 2024-11-12 10:10:35 +00:00
parent 4215fbf561
commit e9b29c8c0b
2 changed files with 92 additions and 0 deletions

View File

@ -1193,6 +1193,67 @@ networking:
- VersionNegotiation
- WrongRole
http_3_quic_frame_count:
type: labeled_counter
description: >
Number of QUIC frames send and received by type.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1929818
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1929818
data_sensitivity:
- technical
notification_emails:
- necko@mozilla.com
- minden@mozilla.com
expires: never
labels:
- ack_tx
- ack_rx
- crypto_tx
- crypto_rx
- stream_tx
- stream_rx
- reset_stream_tx
- reset_stream_rx
- stop_sending_tx
- stop_sending_rx
- ping_tx
- ping_rx
- padding_tx
- padding_rx
- max_streams_tx
- max_streams_rx
- streams_blocked_tx
- streams_blocked_rx
- max_data_tx
- max_data_rx
- data_blocked_tx
- data_blocked_rx
- max_stream_data_tx
- max_stream_data_rx
- stream_data_blocked_tx
- stream_data_blocked_rx
- new_connection_id_tx
- new_connection_id_rx
- retire_connection_id_tx
- retire_connection_id_rx
- path_challenge_tx
- path_challenge_rx
- path_response_tx
- path_response_rx
- connection_close_tx
- connection_close_rx
- handshake_done_tx
- handshake_done_rx
- new_token_tx
- new_token_rx
- ack_frequency_tx
- ack_frequency_rx
- datagram_tx
- datagram_rx
cache_metadata_first_read_time: &cache_metadata_first_read_time
type: timing_distribution
time_unit: millisecond

View File

@ -352,6 +352,37 @@ impl NeqoHttp3Conn {
return;
}
for (s, postfix) in [(stats.frame_tx, "_tx"), (stats.frame_rx, "_rx")] {
let add = |label: &str, value: usize| {
glean::http_3_quic_frame_count
.get(&(label.to_string() + postfix))
.add(value.try_into().unwrap_or(i32::MAX));
};
add("ack", s.ack);
add("crypto", s.crypto);
add("stream", s.stream);
add("reset_stream", s.reset_stream);
add("stop_sending", s.stop_sending);
add("ping", s.ping);
add("padding", s.padding);
add("max_streams", s.max_streams);
add("streams_blocked", s.streams_blocked);
add("max_data", s.max_data);
add("data_blocked", s.data_blocked);
add("max_stream_data", s.max_stream_data);
add("stream_data_blocked", s.stream_data_blocked);
add("new_connection_id", s.new_connection_id);
add("retire_connection_id", s.retire_connection_id);
add("path_challenge", s.path_challenge);
add("path_response", s.path_response);
add("connection_close", s.connection_close);
add("handshake_done", s.handshake_done);
add("new_token", s.new_token);
add("ack_frequency", s.ack_frequency);
add("datagram", s.datagram);
}
if static_prefs::pref!("network.http.http3.ecn") {
if stats.ecn_tx[IpTosEcn::Ect0] > 0 {
let ratio =