diff --git a/netwerk/protocol/http/Http3Session.cpp b/netwerk/protocol/http/Http3Session.cpp index 438b826eb997..189036cd1eb0 100644 --- a/netwerk/protocol/http/Http3Session.cpp +++ b/netwerk/protocol/http/Http3Session.cpp @@ -181,6 +181,9 @@ void Http3Session::Shutdown() { Http3Session::~Http3Session() { LOG3(("Http3Session::~Http3Session %p", this)); + Telemetry::Accumulate(Telemetry::HTTP3_REQUEST_PER_CONN, + mTransactionCount); + Shutdown(); } @@ -655,6 +658,7 @@ nsresult Http3Session::TryActivating( MOZ_ASSERT(*aStreamId != UINT64_MAX); mStreamIdHash.Put(*aStreamId, RefPtr{aStream}); + mTransactionCount++; return NS_OK; } diff --git a/netwerk/protocol/http/Http3Session.h b/netwerk/protocol/http/Http3Session.h index d78e7d5cb70e..69597f244a54 100644 --- a/netwerk/protocol/http/Http3Session.h +++ b/netwerk/protocol/http/Http3Session.h @@ -178,6 +178,8 @@ class Http3Session final : public nsAHttpTransaction, RefPtr mSocketControl; nsCString mAlpnToken; + + uint64_t mTransactionCount = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(Http3Session, NS_HTTP3SESSION_IID); diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index de71bd24a8a0..87b4461b660d 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -483,6 +483,8 @@ nsresult nsHttpHandler::Init() { Preferences::RegisterPrefixCallbacks(nsHttpHandler::PrefsChanged, gCallbackPrefs, this); PrefsChanged(nullptr); + Telemetry::ScalarSet( + Telemetry::ScalarID::NETWORKING_HTTP3_ENABLED, mHttp3Enabled); mMisc.AssignLiteral("rv:" MOZILLA_UAVERSION); diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 1f09e38c29b8..eed8a0871923 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -3319,6 +3319,17 @@ "keyed": true, "description": "Error code when http3 connection is closed. Look at Http3Session for more details." }, + "HTTP3_REQUEST_PER_CONN": { + "record_in_processes": ["main", "content"], + "products": ["firefox"], + "alert_emails": ["necko@mozilla.com", "ddamjanovic@mozilla.com"], + "expires_in_version": "never", + "kind": "exponential", + "high": 1000, + "n_buckets": 50, + "bug_numbers": [1652104], + "description": "HTTP3: Streams created per connection" + }, "HTTP_CONTENT_ENCODING": { "record_in_processes": ["main", "content"], "products": ["firefox", "fennec"], diff --git a/toolkit/components/telemetry/Scalars.yaml b/toolkit/components/telemetry/Scalars.yaml index ef67066e7db1..28b12906da6c 100644 --- a/toolkit/components/telemetry/Scalars.yaml +++ b/toolkit/components/telemetry/Scalars.yaml @@ -4675,6 +4675,24 @@ networking: - 'main' release_channel_collection: opt-out + http3_enabled: + bug_numbers: + - 1652104 + description: > + True if HTTP3 is enabled at the start of a session. + expires: never + kind: boolean + keyed: false + notification_emails: + - necko@mozilla.com + - ddamjanovic@mozilla.com + release_channel_collection: opt-out + products: + - 'firefox' + record_in_processes: + - 'main' + - 'content' + blocklist: lastModified_rs_addons: bug_numbers: