tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit f8304cb9d13daace0fcf98a31811e4a162b21d70
parent 6931d96518b7db62f4f7b29cc0bcbeb32444b8e0
Author: Oskar Mansfeld <git@omansfeld.net>
Date:   Mon,  8 Dec 2025 16:42:31 +0000

Bug 2003794 - Add HTTP3 upload throughput telemetry for 1MB-10MB transfers. r=necko-reviewers,toolkit-telemetry-reviewers,acreskey,kershaw

Also removes old unused `upload_bandwidth_mbps` metric.

Differential Revision: https://phabricator.services.mozilla.com/D274935

Diffstat:
Mnetwerk/metrics.yaml | 20++++++++++++++++++++
Mnetwerk/protocol/http/metrics.yaml | 23-----------------------
Mnetwerk/protocol/http/nsHttpTransaction.cpp | 24++++++++++++++----------
Mtoolkit/components/telemetry/Histograms.json | 13-------------
4 files changed, 34 insertions(+), 46 deletions(-)

diff --git a/netwerk/metrics.yaml b/netwerk/metrics.yaml @@ -966,6 +966,26 @@ networking: expires: never telemetry_mirror: HTTP_UPLOAD_THROUGHPUT_MBPS_HTTP_2_100 + http_3_upload_throughput_1_10: + type: custom_distribution + unit: mbps + range_min: 0 + range_max: 3000 + bucket_count: 100 + histogram_type: exponential + description: > + The upload throughput for http/3 request size between 1MB and 10MB. Measured in megabits per second, Mbps. + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=2003794 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=2003794 + data_sensitivity: + - technical + notification_emails: + - necko@mozilla.com + - omansfeld@mozilla.com + expires: 157 + http_3_upload_throughput_10_50: type: custom_distribution unit: mbps diff --git a/netwerk/protocol/http/metrics.yaml b/netwerk/protocol/http/metrics.yaml @@ -1933,29 +1933,6 @@ http: expires: never telemetry_mirror: h#HTTP_ALTSVC_MAPPING_CHANGED_TARGET - upload_bandwidth_mbps: - type: labeled_custom_distribution - description: > - The upload bandwidth for requests larger than 10MB. Measured in megabits - per second, Mbps. Keyed by HTTP protocol version. - - This metric was generated to correspond to the Legacy Telemetry - exponential histogram HTTP_UPLOAD_BANDWIDTH_MBPS. - range_min: 1 - range_max: 10000 - bucket_count: 100 - histogram_type: exponential - unit: megabits per second - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1830087 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1830087 - notification_emails: - - necko@mozilla.com - - acreskey@mozilla.com - expires: never - telemetry_mirror: HTTP_UPLOAD_BANDWIDTH_MBPS - response_version: type: custom_distribution description: > diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -1313,11 +1313,13 @@ static void MaybeRemoveSSLToken(nsITransportSecurityInfo* aSecurityInfo) { static_cast<uint32_t>(rv))); } -const int64_t TELEMETRY_REQUEST_SIZE_10M = (int64_t)10 * (int64_t)(1 << 20); +const int64_t TELEMETRY_REQUEST_SIZE_1M = (int64_t)(1 << 20); +const int64_t TELEMETRY_REQUEST_SIZE_10M = + (int64_t)10 * TELEMETRY_REQUEST_SIZE_1M; const int64_t TELEMETRY_REQUEST_SIZE_50M = - (int64_t)5 * TELEMETRY_REQUEST_SIZE_10M; + (int64_t)50 * TELEMETRY_REQUEST_SIZE_1M; const int64_t TELEMETRY_REQUEST_SIZE_100M = - (int64_t)10 * TELEMETRY_REQUEST_SIZE_10M; + (int64_t)100 * TELEMETRY_REQUEST_SIZE_1M; void nsHttpTransaction::Close(nsresult reason) { LOG(("nsHttpTransaction::Close [this=%p reason=%" PRIx32 "]\n", this, @@ -3664,21 +3666,23 @@ nsHttpTransaction::GetName(nsACString& aName) { bool nsHttpTransaction::GetSupportsHTTP3() { return mSupportsHTTP3; } void nsHttpTransaction::CollectTelemetryForUploads() { - if ((mRequestSize < TELEMETRY_REQUEST_SIZE_10M) || + if ((mRequestSize < TELEMETRY_REQUEST_SIZE_1M) || mTimings.requestStart.IsNull() || mTimings.responseStart.IsNull()) { return; } - // We will briefly continue to collect HTTP_UPLOAD_BANDWIDTH_MBPS - // (a keyed histogram) while live experiments depend on it. - // Once complete, we can remove and use the glean probes, - // http_1/2/3_upload_throughput. nsAutoCString protocolVersion(nsHttp::GetProtocolVersion(mHttpVersion)); TimeDuration sendTime = mTimings.responseStart - mTimings.requestStart; double megabits = static_cast<double>(mRequestSize) * 8.0 / 1000000.0; uint32_t mpbs = static_cast<uint32_t>(megabits / sendTime.ToSeconds()); - glean::http::upload_bandwidth_mbps.Get(protocolVersion) - .AccumulateSingleSample(mpbs); + + if (mRequestSize <= TELEMETRY_REQUEST_SIZE_10M) { + if (mHttpVersion == HttpVersion::v3_0) { + glean::networking::http_3_upload_throughput_1_10.AccumulateSingleSample( + mpbs); + } + return; + } switch (mHttpVersion) { case HttpVersion::v1_0: diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json @@ -1819,19 +1819,6 @@ "n_buckets": 100, "description": "Time in milliseconds that http channel spent suspended between AsyncOpen and OnStartRequest." }, - "HTTP_UPLOAD_BANDWIDTH_MBPS": { - "record_in_processes": ["main"], - "products": ["firefox"], - "alert_emails": ["necko@mozilla.com", "acreskey@mozilla.com"], - "expires_in_version": "never", - "releaseChannelCollection": "opt-out", - "kind": "exponential", - "high": 10000, - "n_buckets": 100, - "bug_numbers": [1830087], - "keyed": true, - "description": "The upload bandwidth for requests larger than 10MB. Measured in megabits per second, Mbps. Keyed by HTTP protocol version." - }, "NETWORKING_DOWNLOAD_THROUGHPUT_HTTP_1": { "record_in_processes": ["main"], "products": ["firefox"],