Bug 1877576 - Migrate geckoview GVST probes r=geckoview-reviewers,perry.mcmanis,owlish

Most are brought over straightforwardly, their Telemetry callsites reworded
to use Glean, with mirroring to the Telemetry probes taken care of by the Glean
Interface For Firefox Telemetry (see the telemetry_mirror property).

There were some special cases:
* HistogramStopwatch becomes GleanStopwatch.
  After migration it was only serving Glean consumers.
  Could've used standard Glean APIs, but having something to hold the TimerIds
  was convenient.
* GV_STARTUP_MODULES_MS was removed.
  It was configured to only report for the `firefox` product,
  but could only have a value in `geckoview_streaming`,
  so never reported data.
* MEDIA_DECODING_PROCESS_CRASH was removed.
  It was configured to only report for the `firefox` product,
  but could only have a value in `geckoview_streaming`,
  so never reported data.
* GV_CONTENT_PROCESS_LIFETIME_MS was removed.
  It was configured to only report for the `geckoview_streaming` product,
  meaning it only reported data when used with GVST to reach the Glean
  `geckoview.content_process_lifetime` metric.
  This is now accomplished directly.
* GV_STARTUP_RUNTIME_MS was removed.
  Though it was configured to report data for both `firefox` and
  `geckoview_streaming` products, it only ever had values in geckoview.
  Its data continues to be reported via `geckoview.startup_runtime`.
* gecko.version and gecko.build_id (Scalars) were removed.
  In Firefox Desktop this information is available in the `application`
  section of the Environment.
  In geckoview-using products, this information continues to be available via
  `geckoview.version` and `geckoview.build_id`.
* GV_STARTUP_RUNTIME_MS and GV_CONTENT_PROCESS_LIFETIME_MS are handled oddly.
  Since those probes were recorded in the Java portion of the code,
  and that portion doesn't include Glean,
  we use `nativeAddHistogram` to relay the samples for those two pieces of
  instrumentation.
  If there will be more instrumentation landing in that part of the code,
  I recommend you review the instructions for including the Glean SDK in a
  library, and retire this use of JNI.

Differential Revision: https://phabricator.services.mozilla.com/D200094
This commit is contained in:
Perry McManis 2024-02-09 21:11:05 +00:00
parent fc8d53b26b
commit 42245a5b45
14 changed files with 243 additions and 308 deletions

View File

@ -230,10 +230,8 @@ void WindowGlobalParent::OriginCounter::UpdateSiteOriginsFrom(
}
void WindowGlobalParent::OriginCounter::Accumulate() {
mozilla::Telemetry::Accumulate(
mozilla::Telemetry::HistogramID::
FX_NUMBER_OF_UNIQUE_SITE_ORIGINS_PER_DOCUMENT,
mMaxOrigins);
mozilla::glean::geckoview::per_document_site_origins.AccumulateSamples(
{mMaxOrigins});
mMaxOrigins = 0;
mOriginMap.Clear();

View File

@ -18,7 +18,6 @@ ChromeUtils.defineESModuleGetters(this, {
GeckoViewActorManager: "resource://gre/modules/GeckoViewActorManager.sys.mjs",
GeckoViewSettings: "resource://gre/modules/GeckoViewSettings.sys.mjs",
GeckoViewUtils: "resource://gre/modules/GeckoViewUtils.sys.mjs",
HistogramStopwatch: "resource://gre/modules/GeckoViewTelemetry.sys.mjs",
InitializationTracker: "resource://gre/modules/GeckoViewTelemetry.sys.mjs",
RemoteSecuritySettings:
"resource://gre/modules/psm/RemoteSecuritySettings.sys.mjs",
@ -54,13 +53,6 @@ var ModuleManager = {
},
init(aBrowser, aModules) {
const MODULES_INIT_PROBE = new HistogramStopwatch(
"GV_STARTUP_MODULES_MS",
aBrowser
);
MODULES_INIT_PROBE.start();
const initData = this._initData;
this._browser = aBrowser;
this._settings = initData.settings;
@ -121,8 +113,6 @@ var ModuleManager = {
this._modules.clear();
});
MODULES_INIT_PROBE.finish();
},
onPrintWindow(aParams) {

View File

@ -17,7 +17,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.TelemetryUtils;
import org.mozilla.gecko.gfx.GeckoSurface;
public final class RemoteManager implements IBinder.DeathRecipient {
@ -172,7 +171,6 @@ public final class RemoteManager implements IBinder.DeathRecipient {
@Override
public void binderDied() {
Log.e(LOGTAG, "remote codec is dead");
TelemetryUtils.addToHistogram("MEDIA_DECODING_PROCESS_CRASH", 1);
handleRemoteDeath();
}

View File

@ -23,7 +23,7 @@ XPCOMUtils.defineLazyServiceGetter(
ChromeUtils.defineESModuleGetters(lazy, {
BrowserTelemetryUtils: "resource://gre/modules/BrowserTelemetryUtils.sys.mjs",
HistogramStopwatch: "resource://gre/modules/GeckoViewTelemetry.sys.mjs",
GleanStopwatch: "resource://gre/modules/GeckoViewTelemetry.sys.mjs",
});
var IdentityHandler = {
@ -180,15 +180,15 @@ class Tracker {
class ProgressTracker extends Tracker {
constructor(aModule) {
super(aModule);
const window = aModule.browser.ownerGlobal;
this.pageLoadProbe = new lazy.HistogramStopwatch("GV_PAGE_LOAD_MS", window);
this.pageReloadProbe = new lazy.HistogramStopwatch(
"GV_PAGE_RELOAD_MS",
window
this.pageLoadStopwatch = new lazy.GleanStopwatch(
Glean.geckoview.pageLoadTime
);
this.pageLoadProgressProbe = new lazy.HistogramStopwatch(
"GV_PAGE_LOAD_PROGRESS_MS",
window
this.pageReloadStopwatch = new lazy.GleanStopwatch(
Glean.geckoview.pageReloadTime
);
this.pageLoadProgressStopwatch = new lazy.GleanStopwatch(
Glean.geckoview.pageLoadProgressTime
);
this.clear();
@ -212,7 +212,7 @@ class ProgressTracker extends Tracker {
return;
}
this.pageLoadProgressProbe.start();
this.pageLoadProgressStopwatch.start();
data.uri = aUri;
data.pageStart = true;
@ -236,9 +236,9 @@ class ProgressTracker extends Tracker {
}
if (aIsSuccess) {
this.pageLoadProgressProbe.finish();
this.pageLoadProgressStopwatch.finish();
} else {
this.pageLoadProgressProbe.cancel();
this.pageLoadProgressStopwatch.cancel();
}
const data = this._data;
@ -265,7 +265,9 @@ class ProgressTracker extends Tracker {
const isPageReload =
(aWebProgress.loadType & Ci.nsIDocShell.LOAD_CMD_RELOAD) != 0;
const probe = isPageReload ? this.pageReloadProbe : this.pageLoadProbe;
const stopwatch = isPageReload
? this.pageReloadStopwatch
: this.pageLoadStopwatch;
const isStart = (aStateFlags & Ci.nsIWebProgressListener.STATE_START) != 0;
const isStop = (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) != 0;
@ -273,13 +275,13 @@ class ProgressTracker extends Tracker {
(aStateFlags & Ci.nsIWebProgressListener.STATE_REDIRECTING) != 0;
if (isStart) {
probe.start();
stopwatch.start();
this.start(displaySpec);
} else if (isStop && !aWebProgress.isLoadingDocument) {
probe.finish();
stopwatch.finish();
this.stop(aStatus == Cr.NS_OK);
} else if (isRedirecting) {
probe.start();
stopwatch.start();
this.start(displaySpec);
}

View File

@ -15,33 +15,30 @@ export var InitializationTracker = {
},
};
// A helper for histogram timer probes.
export class HistogramStopwatch {
constructor(aName, aAssociated) {
this._name = aName;
this._obj = aAssociated;
// A helper for timing_distribution metrics.
export class GleanStopwatch {
constructor(aTimingDistribution) {
this._metric = aTimingDistribution;
}
isRunning() {
return TelemetryStopwatch.running(this._name, this._obj);
return !!this._timerId;
}
start() {
if (this.isRunning()) {
this.cancel();
}
TelemetryStopwatch.start(this._name, this._obj);
this._timerId = this._metric.start();
}
finish() {
TelemetryStopwatch.finish(this._name, this._obj);
this._metric.stopAndAccumulate(this._timerId);
this._timerId = null;
}
cancel() {
TelemetryStopwatch.cancel(this._name, this._obj);
}
timeElapsed() {
return TelemetryStopwatch.timeElapsed(this._name, this._obj, false);
this._metric.cancel(this._timerId);
this._timerId = null;
}
}

View File

@ -0,0 +1,153 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Adding a new metric? We have docs for that!
# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html
---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
$tags:
- "GeckoView :: General"
geckoview:
page_load_progress_time:
type: timing_distribution
time_unit: millisecond
telemetry_mirror: GV_PAGE_LOAD_PROGRESS_MS
description: >
Time between page load progress starts (0) and completion (100).
(Migrated from the geckoview metric of the same name).
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
- https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877576
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
notification_emails:
- android-probes@mozilla.com
expires: never
page_load_time:
type: timing_distribution
time_unit: millisecond
telemetry_mirror: GV_PAGE_LOAD_MS
description: >
The time taken to load a page. This includes all static contents, no
dynamic content.
Loading of about: pages is not counted.
Back back navigation (sometimes via BFCache) is included which is a
source of bimodality due to the <50ms load times.
(Migrated from the geckoview metric of the same name).
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877576
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- android-probes@mozilla.com
expires: never
page_reload_time:
type: timing_distribution
time_unit: millisecond
telemetry_mirror: GV_PAGE_RELOAD_MS
description: >
Time taken to reload a page.
This includes all static contents, no dynamic content.
Loading of about: pages is not counted.
(Migrated from the geckoview metric of the same name).
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1549519
- https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877576
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
notification_emails:
- android-probes@mozilla.com
- sefeng@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
document_site_origins:
type: custom_distribution
description: >
When a document is loaded, report the
number of [site origins](https://searchfox.org/
mozilla-central/rev/
3300072e993ae05d50d5c63d815260367eaf9179/
caps/nsIPrincipal.idl#264) of the entire browser
if it has been at least 5 minutes since last
time we collect this data.
(Migrated from the geckoview metric of the same name).
range_min: 0
range_max: 100
bucket_count: 50
histogram_type: exponential
unit: number of site_origin
telemetry_mirror: FX_NUMBER_OF_UNIQUE_SITE_ORIGINS_ALL_TABS
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1589700
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877576
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1589700#c5
notification_emails:
- sefeng@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
per_document_site_origins:
type: custom_distribution
description: >
When a document is unloaded, report the highest number of
[site origins](https://searchfox.org/
mozilla-central/rev/
3300072e993ae05d50d5c63d815260367eaf9179/
caps/nsIPrincipal.idl#264) loaded simultaneously in that
document.
(Migrated from the geckoview metric of the same name).
range_min: 0
range_max: 100
bucket_count: 50
histogram_type: exponential
unit: number of site origins per document
telemetry_mirror: FX_NUMBER_OF_UNIQUE_SITE_ORIGINS_PER_DOCUMENT
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1603185
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877576
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1603185#c13
notification_emails:
- barret@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
startup_runtime:
type: timing_distribution
time_unit: millisecond
description: >
The time taken to initialize GeckoRuntime.
(Migrated from the geckoview metric of the same name).
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- android-probes@mozilla.com
expires: never
content_process_lifetime:
type: timing_distribution
time_unit: millisecond
description: >
The uptime of content processes.
(Migrated from the geckoview metric of the same name).
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1625325
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1625325#c2
notification_emails:
- android-probes@mozilla.com
expires: never

View File

@ -23,6 +23,7 @@ gecko_metrics = [
"gfx/metrics.yaml",
"image/decoders/metrics.yaml",
"mobile/android/actors/metrics.yaml",
"mobile/android/modules/geckoview/metrics.yaml",
"netwerk/metrics.yaml",
"netwerk/protocol/http/metrics.yaml",
"security/manager/ssl/metrics.yaml",
@ -38,6 +39,7 @@ gecko_metrics = [
"toolkit/components/translations/metrics.yaml",
"toolkit/mozapps/extensions/metrics.yaml",
"toolkit/mozapps/handling/metrics.yaml",
"toolkit/xre/metrics.yaml",
"xpcom/metrics.yaml",
]
@ -63,7 +65,6 @@ firefox_desktop_metrics = [
"toolkit/components/telemetry/dap/metrics.yaml",
"toolkit/components/telemetry/metrics.yaml",
"toolkit/modules/metrics.yaml",
"toolkit/xre/metrics.yaml",
"widget/cocoa/metrics.yaml",
"widget/windows/metrics.yaml",
]

View File

@ -8665,7 +8665,7 @@
},
"FX_NUMBER_OF_UNIQUE_SITE_ORIGINS_ALL_TABS": {
"record_in_processes": ["main"],
"products": ["firefox", "geckoview_streaming"],
"products": ["firefox"],
"expires_in_version": "never",
"kind": "exponential",
"high": 100,
@ -8677,7 +8677,7 @@
},
"FX_NUMBER_OF_UNIQUE_SITE_ORIGINS_PER_DOCUMENT": {
"record_in_processes": ["main"],
"products": ["firefox", "geckoview_streaming"],
"products": ["firefox"],
"expires_in_version": "never",
"kind": "exponential",
"high": 100,
@ -11335,16 +11335,6 @@
"n_values": 5,
"description": "Counts the number of entries in the sample description box (stsd) for a track in an mp4. Recorded each time we process a track's metadata while parsing mp4s."
},
"MEDIA_DECODING_PROCESS_CRASH": {
"record_in_processes": ["content"],
"products": ["firefox"],
"alert_emails": ["media-alerts@mozilla.com"],
"bug_numbers": [1304268],
"expires_in_version": "never",
"kind": "count",
"operating_systems": ["android"],
"description": "Records a value each time GeckoView remote decoding process crashes unexpectedly while decoding media content."
},
"MEDIA_AUDIO_INIT_FAILURE": {
"record_in_processes": ["main", "content"],
"products": ["firefox"],
@ -17411,20 +17401,9 @@
"alert_emails": ["jvarga@mozilla.com", "storage-telemetry@mozilla.com"],
"description": "Time (ms) for the QuotaManager to shutdown. Keyed by conditions during shutdown, see RecordTimeDeltaHelper::Run in https://searchfox.org/mozilla-central/source/dom/quota/ActorsParent.cpp"
},
"GV_CONTENT_PROCESS_LIFETIME_MS": {
"record_in_processes": ["main"],
"products": ["geckoview_streaming"],
"alert_emails": ["geckoview-team@mozilla.com", "asferro@mozilla.com"],
"expires_in_version": "never",
"kind": "exponential",
"high": 3600000,
"n_buckets": 100,
"bug_numbers": [1625325],
"description": "GeckoView: The uptime of content processes in ms"
},
"GV_PAGE_LOAD_PROGRESS_MS": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec", "geckoview_streaming"],
"products": ["firefox"],
"alert_emails": ["geckoview-team@mozilla.com", "esawin@mozilla.com"],
"expires_in_version": "never",
"kind": "exponential",
@ -17435,7 +17414,7 @@
},
"GV_PAGE_LOAD_MS": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec", "geckoview_streaming"],
"products": ["firefox"],
"alert_emails": ["geckoview-team@mozilla.com", "esawin@mozilla.com"],
"expires_in_version": "never",
"kind": "exponential",
@ -17446,7 +17425,7 @@
},
"GV_PAGE_RELOAD_MS": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec", "geckoview_streaming"],
"products": ["firefox"],
"alert_emails": [
"geckoview-team@mozilla.com",
"sefeng@mozilla.com",
@ -17459,28 +17438,6 @@
"bug_numbers": [1549519, 1580077],
"description": "GeckoView: Time taken to reload a page in ms. This includes all static contents, no dynamic content. Loading of about: pages is not counted."
},
"GV_STARTUP_RUNTIME_MS": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec", "geckoview_streaming"],
"alert_emails": ["geckoview-team@mozilla.com", "esawin@mozilla.com"],
"expires_in_version": "never",
"kind": "exponential",
"high": 10000,
"n_buckets": 50,
"bug_numbers": [1499418, 1584109],
"description": "GeckoView: Time taken to initialize GeckoRuntime in ms."
},
"GV_STARTUP_MODULES_MS": {
"record_in_processes": ["main"],
"products": ["firefox", "fennec"],
"alert_emails": ["geckoview-team@mozilla.com", "esawin@mozilla.com"],
"expires_in_version": "never",
"kind": "exponential",
"high": 5000,
"n_buckets": 50,
"bug_numbers": [1499418],
"description": "GeckoView: Time taken to initialize all GeckoView modules in ms."
},
"HTTP_TRAFFIC_ANALYSIS_3": {
"record_in_processes": ["main"],
"products": ["firefox", "fennec"],

View File

@ -1439,42 +1439,6 @@ cookie.banners.click:
- 'content'
release_channel_collection: opt-out
gecko:
version:
bug_numbers:
- 1611240
description: >
The version of the Gecko engine, example: '74.0a1'.
It consists of the major and minor version, followed by the release life cycle phase.
'a' stands for alpha or nightly, 'b' stands for beta.
The number behind the release life cycle phase indicates minor releases within the phase.
expires: never
kind: string
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- ktaeleman@mozilla.com
products:
- 'geckoview_streaming'
record_in_processes:
- 'main'
release_channel_collection: opt-out
build_id:
bug_numbers:
- 1611240
description: >
The build id of the Gecko engine, example: '20200205124310'.
It contains the time the build was created and is used as a unique id for the build.
expires: never
kind: string
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- ktaeleman@mozilla.com
products:
- 'geckoview_streaming'
record_in_processes:
- 'main'
release_channel_collection: opt-out
extensions.apis.dnr:
startup_cache_entries:
bug_numbers:

View File

@ -12,174 +12,6 @@
---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
geckoview:
version:
description: >
The version of the Gecko engine, example: 74.0a1
type: string
# Temporary misuse of the user lifetime approved by Glean team
# due to limitations in Geckoview streaming telemetry.
# DO NOT DUPLICATE unless approved by Glean team.
lifetime: user
gecko_datapoint: gecko.version
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1611240
- https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1611240#c2
notification_emails:
- gfx-telemetry-alerts@mozilla.com
expires: never
build_id:
description: >
The Buildid of the Gecko engine, example: 20200205124310
type: string
# Temporary misuse of the user lifetime approved by Glean team
# due to limitations in Geckoview streaming telemetry.
# DO NOT DUPLICATE unless approved by Glean team.
lifetime: user
gecko_datapoint: gecko.build_id
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1611240
- https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1611240#c2
notification_emails:
- gfx-telemetry-alerts@mozilla.com
expires: never
content_process_lifetime:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: GV_CONTENT_PROCESS_LIFETIME_MS
description: >
The uptime of content processes in ms
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1625325
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1625325#c2
notification_emails:
- android-probes@mozilla.com
expires: never
page_load_progress_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: GV_PAGE_LOAD_PROGRESS_MS
description: >
Time between page load progress starts (0) and completion (100).
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
- https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
notification_emails:
- android-probes@mozilla.com
expires: never
page_load_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: GV_PAGE_LOAD_MS
description: >
The time taken to load a page. This includes all static contents, no
dynamic content.
Loading of about: pages is not counted.
Back back navigation (sometimes via BFCache) is included which is a
source of bimodality due to the <50ms load times.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- android-probes@mozilla.com
expires: never
page_reload_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: GV_PAGE_RELOAD_MS
description: >
Time taken to reload a page.
This includes all static contents, no dynamic content.
Loading of about: pages is not counted.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1549519
- https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
notification_emails:
- android-probes@mozilla.com
- sefeng@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
startup_runtime:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: GV_STARTUP_RUNTIME_MS
description: >
The time taken to initialize GeckoRuntime.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- android-probes@mozilla.com
expires: never
document_site_origins:
type: custom_distribution
description: >
When a document is loaded, report the
number of [site origins](https://searchfox.org/
mozilla-central/rev/
3300072e993ae05d50d5c63d815260367eaf9179/
caps/nsIPrincipal.idl#264) of the entire browser
if it has been at least 5 minutes since last
time we collect this data.
range_min: 0
range_max: 100
bucket_count: 50
histogram_type: exponential
unit: number of site_origin
gecko_datapoint: FX_NUMBER_OF_UNIQUE_SITE_ORIGINS_ALL_TABS
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1589700
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1589700#c5
notification_emails:
- sefeng@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
per_document_site_origins:
type: custom_distribution
description: >
When a document is unloaded, report the highest number of
[site origins](https://searchfox.org/
mozilla-central/rev/
3300072e993ae05d50d5c63d815260367eaf9179/
caps/nsIPrincipal.idl#264) loaded simultaneously in that
document.
range_min: 0
range_max: 100
bucket_count: 50
histogram_type: exponential
unit: number of site origins per document
gecko_datapoint: FX_NUMBER_OF_UNIQUE_SITE_ORIGINS_PER_DOCUMENT
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1603185
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1603185#c13
notification_emails:
- barret@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
performance.pageload:
load_time:
type: timing_distribution

View File

@ -56,9 +56,6 @@ export var BrowserTelemetryUtils = {
}
let originCount = this.computeSiteOriginCount(aWindows, aIsGeckoView);
let histogram = Services.telemetry.getHistogramById(
"FX_NUMBER_OF_UNIQUE_SITE_ORIGINS_ALL_TABS"
);
// Discard the first load because most of the time the first load only has 1
// tab and 1 window open, so it is useless to report it.
@ -67,7 +64,7 @@ export var BrowserTelemetryUtils = {
} else if (currentTime >= this._lastRecordSiteOrigin + this.min_interval) {
this._lastRecordSiteOrigin = currentTime;
histogram.add(originCount);
Glean.geckoview.documentSiteOrigins.accumulateSamples([originCount]);
}
},
};

View File

@ -9,3 +9,42 @@
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
$tags:
- "Toolkit :: Startup and Profile System"
gecko:
version:
description: >
The version of the Gecko engine, example: 74.0a1
(Migrated from the geckoview metric of the same name).
type: string
# Temporary misuse of the user lifetime approved by Glean team
# due to limitations in Geckoview streaming telemetry.
# DO NOT DUPLICATE unless approved by Glean team.
lifetime: user
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1611240
- https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877576
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1611240#c2
notification_emails:
- gfx-telemetry-alerts@mozilla.com
expires: never
build_id:
description: >
The Buildid of the Gecko engine, example: 20200205124310
(Migrated from the geckoview metric of the same name).
type: string
# Temporary misuse of the user lifetime approved by Glean team
# due to limitations in Geckoview streaming telemetry.
# DO NOT DUPLICATE unless approved by Glean team.
lifetime: user
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1611240
- https://bugzilla.mozilla.org/show_bug.cgi?id=1687219
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877576
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1611240#c2
notification_emails:
- gfx-telemetry-alerts@mozilla.com
expires: never

View File

@ -36,6 +36,7 @@
#include "mozilla/intl/LocaleService.h"
#include "mozilla/JSONWriter.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/glean/GleanMetrics.h"
#include "mozilla/glean/GleanPings.h"
#include "mozilla/widget/TextRecognition.h"
#include "BaseProfiler.h"
@ -5656,10 +5657,8 @@ nsresult XREMain::XRE_mainRun() {
#endif /* MOZ_INSTRUMENT_EVENT_LOOP */
// Send Telemetry about Gecko version and buildid
Telemetry::ScalarSet(Telemetry::ScalarID::GECKO_VERSION,
NS_ConvertASCIItoUTF16(gAppData->version));
Telemetry::ScalarSet(Telemetry::ScalarID::GECKO_BUILD_ID,
NS_ConvertASCIItoUTF16(gAppData->buildID));
mozilla::glean::gecko::version.Set(nsDependentCString(gAppData->version));
mozilla::glean::gecko::build_id.Set(nsDependentCString(gAppData->buildID));
#if defined(MOZ_SANDBOX) && defined(XP_LINUX)
// If we're on Linux, we now have information about the OS capabilities

View File

@ -10,7 +10,8 @@
#include "nsAppShell.h"
#include "nsIAndroidBridge.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/glean/GleanMetrics.h"
namespace mozilla {
namespace widget {
@ -21,7 +22,14 @@ class Telemetry final : public java::TelemetryUtils::Natives<Telemetry> {
public:
static void AddHistogram(jni::String::Param aName, int32_t aValue) {
MOZ_ASSERT(aName);
mozilla::Telemetry::Accumulate(aName->ToCString().get(), aValue);
nsCString name = aName->ToCString();
if (name.EqualsLiteral("GV_STARTUP_RUNTIME_MS")) {
glean::geckoview::startup_runtime.AccumulateRawDuration(
TimeDuration::FromMilliseconds(aValue));
} else if (name.EqualsLiteral("GV_CONTENT_PROCESS_LIFETIME_MS")) {
glean::geckoview::content_process_lifetime.AccumulateRawDuration(
TimeDuration::FromMilliseconds(aValue));
}
}
};