tor-browser

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

commit 5cc32271f979b425a4614ab8fb085f47ae96979b
parent 707e6c289d8593ccb0205b070a79c1056dfc0ec2
Author: acreskeyMoz <acreskey@mozilla.com>
Date:   Mon, 24 Nov 2025 19:56:09 +0000

Bug 1992829 - Remove or limit to beta and earlier the high-volume but low-value networking probes r=necko-reviewers,toolkit-telemetry-reviewers,jesup

To minimized performance impact and as general data best practices, let's remove or limit the channel collection for probes for which we are not currently deriving much value.

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

Diffstat:
Mdom/base/Document.cpp | 16----------------
Mdom/metrics.yaml | 62--------------------------------------------------------------
Mnetwerk/cache2/CacheStorageService.cpp | 6++++--
Mnetwerk/metrics.yaml | 21---------------------
Mnetwerk/protocol/http/HttpChannelChild.cpp | 22----------------------
Mnetwerk/protocol/http/HttpChannelParent.cpp | 14--------------
Mnetwerk/protocol/http/metrics.yaml | 119-------------------------------------------------------------------------------
Mnetwerk/protocol/http/nsHttpChannel.cpp | 3---
Mnetwerk/protocol/http/nsHttpConnectionMgr.cpp | 9---------
Mnetwerk/protocol/http/nsHttpTransaction.cpp | 5-----
Mtoolkit/components/telemetry/Histograms.json | 103-------------------------------------------------------------------------------
11 files changed, 4 insertions(+), 376 deletions(-)

diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp @@ -2464,15 +2464,6 @@ void Document::AccumulatePageLoadTelemetry() { glean::performance_pageload::fcp.AccumulateRawDuration( firstContentfulComposite - navigationStart); - if (!http3Key.IsEmpty()) { - glean::perf::http3_first_contentful_paint.Get(http3Key) - .AccumulateRawDuration(firstContentfulComposite - navigationStart); -#ifndef ANDROID - AccumulateHttp3FcpGleanPref(http3Key, - firstContentfulComposite - navigationStart); -#endif - } - if (!http3WithPriorityKey.IsEmpty()) { glean::perf::h3p_first_contentful_paint.Get(http3WithPriorityKey) .AccumulateRawDuration(firstContentfulComposite - navigationStart); @@ -2482,9 +2473,6 @@ void Document::AccumulatePageLoadTelemetry() { #endif } - glean::perf::dns_first_contentful_paint.Get(dnsKey).AccumulateRawDuration( - firstContentfulComposite - navigationStart); - glean::performance_pageload::fcp_responsestart.AccumulateRawDuration( firstContentfulComposite - responseStart); @@ -2508,10 +2496,6 @@ void Document::AccumulatePageLoadTelemetry() { GetNavigationTiming()->GetLoadEventStartTimeStamp()) { glean::performance_pageload::load_time.AccumulateRawDuration( loadEventStart - navigationStart); - if (!http3Key.IsEmpty()) { - glean::perf::http3_page_load_time.Get(http3Key).AccumulateRawDuration( - loadEventStart - navigationStart); - } if (!http3WithPriorityKey.IsEmpty()) { glean::perf::h3p_page_load_time.Get(http3WithPriorityKey) diff --git a/dom/metrics.yaml b/dom/metrics.yaml @@ -254,46 +254,6 @@ perf: - perf-telemetry-alerts@mozilla.com expires: never - http3_page_load_time: - type: labeled_timing_distribution - description: > - Time in milliseconds from navigationStart to loadEventStart for the - foreground http or https root content document. This is collected only on - page load where the main document uses or suppports HTTP3 - - This metric was generated to correspond to the Legacy Telemetry - exponential histogram HTTP3_PERF_PAGE_LOAD_TIME_MS. - time_unit: millisecond - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1675503 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1675503 - notification_emails: - - necko@mozilla.com - expires: never - telemetry_mirror: HTTP3_PERF_PAGE_LOAD_TIME_MS - - http3_first_contentful_paint: - type: labeled_timing_distribution - description: > - The time between navigationStart and the first contentful paint of a - foreground http or https root content document, in milliseconds. The - contentful paint timestamp is taken during display list building and does - not include rasterization or compositing of that paint. This is collected - only on page load where the main document uses or suppports HTTP3 - - This metric was generated to correspond to the Legacy Telemetry - exponential histogram HTTP3_PERF_FIRST_CONTENTFUL_PAINT_MS. - time_unit: millisecond - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1675503 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1675503 - notification_emails: - - necko@mozilla.com - expires: never - telemetry_mirror: HTTP3_PERF_FIRST_CONTENTFUL_PAINT_MS - h3p_page_load_time: type: labeled_timing_distribution description: > @@ -340,28 +300,6 @@ perf: expires: never telemetry_mirror: H3P_PERF_FIRST_CONTENTFUL_PAINT_MS - dns_first_contentful_paint: - type: labeled_timing_distribution - description: > - The time between navigationStart and the first contentful paint of a - foreground http or https root content document, in milliseconds. The - contentful paint timestamp is taken during display list building and does - not include rasterization or compositing of that paint. Keyed by TRR - domain for DoH or 'Native' otherwise - - This metric was generated to correspond to the Legacy Telemetry - exponential histogram DNS_PERF_FIRST_CONTENTFUL_PAINT_MS. - time_unit: millisecond - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1796639 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1796639 - notification_emails: - - necko@mozilla.com - - acreskey@mozilla.com - expires: never - telemetry_mirror: DNS_PERF_FIRST_CONTENTFUL_PAINT_MS - dns_first_byte: type: labeled_timing_distribution description: > diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp @@ -2295,8 +2295,10 @@ void CacheStorageService::TelemetryRecordEntryRemoval(CacheEntry* entry) { glean::network::http_cache_entry_reuse_count.AccumulateSingleSample( entry->UseCount()); - glean::network::http_cache_entry_alive_time.AccumulateRawDuration( - TimeStamp::NowLoRes() - entry->LoadStart()); + if (Telemetry::CanRecordPrereleaseData()) { + glean::network::http_cache_entry_alive_time.AccumulateRawDuration( + TimeStamp::NowLoRes() - entry->LoadStart()); + } } // nsIMemoryReporter diff --git a/netwerk/metrics.yaml b/netwerk/metrics.yaml @@ -11,27 +11,6 @@ $tags: - 'Core :: Networking' networking: - speculative_connect_outcome: - type: labeled_counter - description: > - Counts the occurrence of each outcome of a speculative connection - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=909865 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=909865 - data_sensitivity: - - technical - notification_emails: - - necko@mozilla.com - - acreskey@mozilla.com - expires: never - labels: - - successful - - aborted_socket_limit - - aborted_socket_fail - - aborted_https_not_enabled - telemetry_mirror: NETWORKING_SPECULATIVE_CONNECT_OUTCOME - cookie_timestamp_fixed_count: type: labeled_counter description: > diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp @@ -444,26 +444,14 @@ void HttpChannelChild::OnStartRequest( ResourceTimingStructArgsToTimingsStruct(aArgs.timing(), mTransactionTimings); - nsAutoCString cosString; - ClassOfService::ToString(mClassOfService, cosString); if (!mAsyncOpenTime.IsNull() && !aArgs.timing().transactionPending().IsNull()) { - glean::network::async_open_child_to_transaction_pending_exp.Get(cosString) - .AccumulateRawDuration(aArgs.timing().transactionPending() - - mAsyncOpenTime); PerfStats::RecordMeasurement( PerfStats::Metric::HttpChannelAsyncOpenToTransactionPending, aArgs.timing().transactionPending() - mAsyncOpenTime); } const TimeStamp now = TimeStamp::Now(); - if (!aArgs.timing().responseStart().IsNull()) { - glean::network::response_start_parent_to_content_exp.Get(cosString) - .AccumulateRawDuration(now - aArgs.timing().responseStart()); - PerfStats::RecordMeasurement( - PerfStats::Metric::HttpChannelResponseStartParentToContent, - now - aArgs.timing().responseStart()); - } if (!mOnStartRequestStartTime.IsNull()) { PerfStats::RecordMeasurement(PerfStats::Metric::OnStartRequestToContent, now - mOnStartRequestStartTime); @@ -1024,16 +1012,6 @@ void HttpChannelChild::OnStopRequest( PerfStats::RecordMeasurement(PerfStats::Metric::HttpChannelCompletion, channelCompletionDuration); - if (!aTiming.responseEnd().IsNull()) { - nsAutoCString cosString; - ClassOfService::ToString(mClassOfService, cosString); - glean::network::response_end_parent_to_content.Get(cosString) - .AccumulateRawDuration(now - aTiming.responseEnd()); - PerfStats::RecordMeasurement( - PerfStats::Metric::HttpChannelResponseEndParentToContent, - now - aTiming.responseEnd()); - } - if (!mOnStopRequestStartTime.IsNull()) { PerfStats::RecordMeasurement(PerfStats::Metric::OnStopRequestToContent, now - mOnStopRequestStartTime); diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp @@ -1354,20 +1354,6 @@ HttpChannelParent::OnStartRequest(nsIRequest* aRequest) { (void)SendOnStartRequestSent(); } - if (!args.timing().domainLookupEnd().IsNull() && - !args.timing().connectStart().IsNull()) { - nsAutoCString protocolVersion; - mChannel->GetProtocolVersion(protocolVersion); - uint32_t classOfServiceFlags = 0; - mChannel->GetClassFlags(&classOfServiceFlags); - nsAutoCString cosString; - ClassOfService::ToString(classOfServiceFlags, cosString); - nsAutoCString key( - nsPrintfCString("%s_%s", protocolVersion.get(), cosString.get())); - glean::network::dns_end_to_connect_start_exp.Get(key).AccumulateRawDuration( - args.timing().connectStart() - args.timing().domainLookupEnd()); - } - return rv; } diff --git a/netwerk/protocol/http/metrics.yaml b/netwerk/protocol/http/metrics.yaml @@ -805,28 +805,6 @@ network: telemetry_mirror: HTTP3_COMPLETE_LOAD expires: never - http_fetch_duration: - type: labeled_timing_distribution - time_unit: millisecond - description: > - The time between requestStart and responseEnd, keyed by the server header - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1902931 - - https://bugzilla.mozilla.org/show_bug.cgi?id=1935196 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1902931 - notification_emails: - - necko@mozilla.com - - kershaw@mozilla.com - labels: - - h3_cloudflare - - h3_others - - h2_cloudflare - - h2_others - - h1_cloudflare - - h1_others - expires: never - system_channel_success_or_failure: &system_channel_success_or_failure type: labeled_counter description: > @@ -1000,23 +978,6 @@ network: expires: never telemetry_mirror: NETWORK_RACE_CACHE_BANDWIDTH_RACE_CACHE_WIN - race_cache_bandwidth_not_race: - type: memory_distribution - description: > - Amount of bytes received when we decide not to race cache with network. - - This metric was generated to correspond to the Legacy Telemetry - exponential histogram NETWORK_RACE_CACHE_BANDWIDTH_NOT_RACE. - memory_unit: byte - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1354405 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1354405 - notification_emails: - - necko@mozilla.com - expires: never - telemetry_mirror: NETWORK_RACE_CACHE_BANDWIDTH_NOT_RACE - race_cache_validation: type: labeled_counter description: > @@ -1123,86 +1084,6 @@ network: expires: never telemetry_mirror: NETWORK_BACK_PRESSURE_SUSPENSION_DELAY_TIME_MS - async_open_child_to_transaction_pending_exp: - type: labeled_timing_distribution - description: > - The time spent from HttpChannelChild::AsyncOpen to adding the - transactionto the nsHttpConnectionMgr, in milliseconds, keyed by the - classOfService flags - - This metric was generated to correspond to the Legacy Telemetry - exponential histogram - NETWORK_ASYNC_OPEN_CHILD_TO_TRANSACTION_PENDING_EXP_MS. - time_unit: millisecond - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1789468 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1789468 - notification_emails: - - necko@mozilla.com - - acreskey@mozilla.com - expires: never - telemetry_mirror: NETWORK_ASYNC_OPEN_CHILD_TO_TRANSACTION_PENDING_EXP_MS - - response_start_parent_to_content_exp: - type: labeled_timing_distribution - description: > - The time spent relaying response start from the socket thread of the - parent process to the content process, in milliseconds, keyed by the - classOfService flags - - This metric was generated to correspond to the Legacy Telemetry - exponential histogram NETWORK_RESPONSE_START_PARENT_TO_CONTENT_EXP_MS. - time_unit: millisecond - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1793975 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1793975 - notification_emails: - - necko@mozilla.com - - acreskey@mozilla.com - expires: never - telemetry_mirror: NETWORK_RESPONSE_START_PARENT_TO_CONTENT_EXP_MS - - dns_end_to_connect_start_exp: - type: labeled_timing_distribution - description: > - The time spent from dns resolution to connect start, in milliseconds, - keyed by protocol version and the classOfService flags - - This metric was generated to correspond to the Legacy Telemetry - exponential histogram NETWORK_DNS_END_TO_CONNECT_START_EXP_MS. - time_unit: millisecond - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1791077 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1791077 - notification_emails: - - necko@mozilla.com - - acreskey@mozilla.com - expires: never - telemetry_mirror: NETWORK_DNS_END_TO_CONNECT_START_EXP_MS - - response_end_parent_to_content: - type: labeled_timing_distribution - description: > - The time spent relaying response completion from the socket thread of the - parent process to the content process, in milliseconds, keyed by the - classOfService flags - - This metric was generated to correspond to the Legacy Telemetry - exponential histogram NETWORK_RESPONSE_END_PARENT_TO_CONTENT_MS. - time_unit: millisecond - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1795775 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1795775 - notification_emails: - - necko@mozilla.com - - acreskey@mozilla.com - expires: never - telemetry_mirror: NETWORK_RESPONSE_END_PARENT_TO_CONTENT_MS - trr_idle_close_time_h1: &trr_idle_close_time type: labeled_timing_distribution description: > diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp @@ -11584,7 +11584,6 @@ void nsHttpChannel::ReportRcwnStats(bool isFromNet) { nsPrintfCString( "Cache won or was replaced, valid = %d, channel %p, URI %s", LoadCachedContentIsValid(), this, mSpec.get())); - glean::network::race_cache_bandwidth_not_race.Accumulate(mTransferSize); } } else { if (mRaceCacheWithNetwork || mRaceDelay) { @@ -11595,8 +11594,6 @@ void nsHttpChannel::ReportRcwnStats(bool isFromNet) { gIOService->IncrementCacheWonRequestNumber(); glean::network::race_cache_bandwidth_race_cache_win.Accumulate( mTransferSize); - } else { - glean::network::race_cache_bandwidth_not_race.Accumulate(mTransferSize); } } diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -3558,21 +3558,12 @@ void nsHttpConnectionMgr::DoSpeculativeConnectionInternal( isFromPredictor, false, allow1918, nullptr); if (NS_FAILED(rv)) { - glean::networking::speculative_connect_outcome - .Get("aborted_socket_fail"_ns) - .Add(1); LOG( ("DoSpeculativeConnectionInternal Transport socket creation " "failure: %" PRIx32 "\n", static_cast<uint32_t>(rv))); - } else { - glean::networking::speculative_connect_outcome.Get("successful"_ns) - .Add(1); } } else { - glean::networking::speculative_connect_outcome - .Get("aborted_socket_limit"_ns) - .Add(1); LOG( ("DoSpeculativeConnectionInternal Transport ci=%s " "not created due to existing connection count:%d", diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -1713,11 +1713,6 @@ void nsHttpTransaction::Close(nsresult reason) { default: break; } - - if (!serverKey.IsEmpty()) { - glean::network::http_fetch_duration.Get(serverKey).AccumulateRawDuration( - elapsed); - } } if (mTrafficCategory != HttpTrafficCategory::eInvalid) { diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json @@ -1720,32 +1720,6 @@ "keyed": true, "description": "HTTP channel (keys: uses_http3_page, uses_http3_sub, supports_http3_page, supports_http3_sub): Overall load time - network (ms)" }, - "HTTP3_PERF_PAGE_LOAD_TIME_MS": { - "record_in_processes": ["content"], - "products": ["firefox"], - "alert_emails": ["necko@mozilla.com", "ddamjanovic@mozilla.com"], - "expires_in_version": "never", - "releaseChannelCollection": "opt-out", - "kind": "exponential", - "high": 50000, - "n_buckets": 100, - "bug_numbers": [1675503], - "keyed": true, - "description": "Time in milliseconds from navigationStart to loadEventStart for the foreground http or https root content document. This is collected only on page load where the main document uses or suppports HTTP3" - }, - "HTTP3_PERF_FIRST_CONTENTFUL_PAINT_MS": { - "record_in_processes": ["content"], - "products": ["firefox"], - "alert_emails": ["necko@mozilla.com", "ddamjanovic@mozilla.com"], - "expires_in_version": "never", - "releaseChannelCollection": "opt-out", - "kind": "exponential", - "high": 50000, - "n_buckets": 100, - "bug_numbers": [1675503], - "keyed": true, - "description": "The time between navigationStart and the first contentful paint of a foreground http or https root content document, in milliseconds. The contentful paint timestamp is taken during display list building and does not include rasterization or compositing of that paint. This is collected only on page load where the main document uses or suppports HTTP3" - }, "H3P_PERF_PAGE_LOAD_TIME_MS": { "record_in_processes": ["content"], "products": ["firefox"], @@ -2058,18 +2032,6 @@ "alert_emails": ["necko@mozilla.com", "mnovotny@mozilla.com"], "bug_numbers": [1354405] }, - "NETWORK_RACE_CACHE_BANDWIDTH_NOT_RACE": { - "record_in_processes": ["main", "content"], - "products": ["firefox", "fennec"], - "expires_in_version": "never", - "kind": "exponential", - "low": 32, - "high": 16777216, - "n_buckets": 100, - "description": "Amount of bytes received when we decide not to race cache with network.", - "alert_emails": ["necko@mozilla.com", "mnovotny@mozilla.com"], - "bug_numbers": [1354405] - }, "NETWORK_RACE_CACHE_VALIDATION": { "record_in_processes": ["main"], "products": ["firefox", "fennec"], @@ -2116,58 +2078,6 @@ "n_buckets": 100, "description": "The delay caused by the e10s back pressure suspension(ms)" }, - "NETWORK_ASYNC_OPEN_CHILD_TO_TRANSACTION_PENDING_EXP_MS": { - "record_in_processes": ["content"], - "products": ["firefox", "fennec"], - "alert_emails": ["necko@mozilla.com", "acreskey@mozilla.com"], - "bug_numbers": [1789468], - "expires_in_version": "never", - "releaseChannelCollection": "opt-out", - "keyed": true, - "kind": "exponential", - "high": 2000, - "n_buckets": 50, - "description": "The time spent from HttpChannelChild::AsyncOpen to adding the transactionto the nsHttpConnectionMgr, in milliseconds, keyed by the classOfService flags" - }, - "NETWORK_RESPONSE_START_PARENT_TO_CONTENT_EXP_MS": { - "record_in_processes": ["content"], - "products": ["firefox", "fennec"], - "alert_emails": ["necko@mozilla.com", "acreskey@mozilla.com"], - "bug_numbers": [1793975], - "expires_in_version": "never", - "releaseChannelCollection": "opt-out", - "keyed": true, - "kind": "exponential", - "high": 2000, - "n_buckets": 50, - "description": "The time spent relaying response start from the socket thread of the parent process to the content process, in milliseconds, keyed by the classOfService flags" - }, - "NETWORK_DNS_END_TO_CONNECT_START_EXP_MS": { - "record_in_processes": ["main"], - "products": ["firefox", "fennec"], - "alert_emails": ["necko@mozilla.com", "acreskey@mozilla.com"], - "bug_numbers": [1791077], - "expires_in_version": "never", - "releaseChannelCollection": "opt-out", - "keyed": true, - "kind": "exponential", - "high": 2000, - "n_buckets": 50, - "description": "The time spent from dns resolution to connect start, in milliseconds, keyed by protocol version and the classOfService flags" - }, - "NETWORK_RESPONSE_END_PARENT_TO_CONTENT_MS": { - "record_in_processes": ["content"], - "products": ["firefox", "fennec"], - "alert_emails": ["necko@mozilla.com", "acreskey@mozilla.com"], - "bug_numbers": [1795775], - "expires_in_version": "never", - "releaseChannelCollection": "opt-out", - "keyed": true, - "kind": "exponential", - "high": 2000, - "n_buckets": 50, - "description": "The time spent relaying response completion from the socket thread of the parent process to the content process, in milliseconds, keyed by the classOfService flags" - }, "TLS_EARLY_DATA_NEGOTIATED": { "record_in_processes": ["main", "socket"], "products": ["firefox", "fennec"], @@ -3375,19 +3285,6 @@ "kind": "enumerated", "description": "The reason why we failed to connect with an HTTPSSVC record" }, - "DNS_PERF_FIRST_CONTENTFUL_PAINT_MS": { - "record_in_processes": ["content"], - "products": ["firefox"], - "alert_emails": ["necko@mozilla.com", "acreskey@mozilla.com"], - "expires_in_version": "never", - "releaseChannelCollection": "opt-out", - "kind": "exponential", - "high": 50000, - "n_buckets": 100, - "bug_numbers": [1796639], - "keyed": true, - "description": "The time between navigationStart and the first contentful paint of a foreground http or https root content document, in milliseconds. The contentful paint timestamp is taken during display list building and does not include rasterization or compositing of that paint. Keyed by TRR domain for DoH or 'Native' otherwise" - }, "DNS_PERF_FIRST_BYTE_MS": { "record_in_processes": ["content"], "products": ["firefox"],