Bug 1918702 - Migrate telemetry events to use Glean APIs for downloads.added, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D222805
This commit is contained in:
@@ -132,8 +132,6 @@ const FILE_EXTENSIONS = [
|
|||||||
"zip",
|
"zip",
|
||||||
];
|
];
|
||||||
|
|
||||||
const TELEMETRY_EVENT_CATEGORY = "downloads";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a collection of Download objects that can be viewed and managed by
|
* Represents a collection of Download objects that can be viewed and managed by
|
||||||
* the user interface, and persisted across sessions.
|
* the user interface, and persisted across sessions.
|
||||||
@@ -406,20 +404,7 @@ export class DownloadCombinedList extends DownloadList {
|
|||||||
extension = "other";
|
extension = "other";
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
Glean.downloads.addedFileExtension.record({ value: extension });
|
||||||
Services.telemetry.recordEvent(
|
|
||||||
TELEMETRY_EVENT_CATEGORY,
|
|
||||||
"added",
|
|
||||||
"fileExtension",
|
|
||||||
extension,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
} catch (ex) {
|
|
||||||
console.error(
|
|
||||||
"DownloadsCommon: error recording telemetry event.",
|
|
||||||
ex.message
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (download.source.isPrivate) {
|
if (download.source.isPrivate) {
|
||||||
return this._privateList.add(download);
|
return this._privateList.add(download);
|
||||||
|
|||||||
37
toolkit/components/downloads/metrics.yaml
Normal file
37
toolkit/components/downloads/metrics.yaml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# 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:
|
||||||
|
- 'Toolkit :: Downloads API'
|
||||||
|
|
||||||
|
downloads:
|
||||||
|
added_file_extension:
|
||||||
|
type: event
|
||||||
|
description: >
|
||||||
|
Sent when downloading a new file.
|
||||||
|
This event was generated to correspond to the Legacy Telemetry event
|
||||||
|
downloads.added#fileExtension.
|
||||||
|
bugs:
|
||||||
|
- https://bugzil.la/1627676
|
||||||
|
- https://bugzil.la/1706355
|
||||||
|
data_reviews:
|
||||||
|
- https://bugzil.la/1627676
|
||||||
|
- https://bugzil.la/1706355
|
||||||
|
notification_emails:
|
||||||
|
- rtestard@mozilla.com
|
||||||
|
- emalysz@mozilla.com
|
||||||
|
expires: never
|
||||||
|
extra_keys:
|
||||||
|
value:
|
||||||
|
description: >
|
||||||
|
Possible values are in contained in
|
||||||
|
DownloadList::kFileExtensions.
|
||||||
|
All other downloads not in the list are marked as other.
|
||||||
|
type: string
|
||||||
|
telemetry_mirror: Downloads_Added_Fileextension
|
||||||
@@ -40,6 +40,7 @@ gecko_metrics = [
|
|||||||
"security/manager/ssl/metrics.yaml",
|
"security/manager/ssl/metrics.yaml",
|
||||||
"toolkit/components/antitracking/bouncetrackingprotection/metrics.yaml",
|
"toolkit/components/antitracking/bouncetrackingprotection/metrics.yaml",
|
||||||
"toolkit/components/cookiebanners/metrics.yaml",
|
"toolkit/components/cookiebanners/metrics.yaml",
|
||||||
|
"toolkit/components/downloads/metrics.yaml",
|
||||||
"toolkit/components/extensions/metrics.yaml",
|
"toolkit/components/extensions/metrics.yaml",
|
||||||
"toolkit/components/formautofill/metrics.yaml",
|
"toolkit/components/formautofill/metrics.yaml",
|
||||||
"toolkit/components/glean/metrics.yaml",
|
"toolkit/components/glean/metrics.yaml",
|
||||||
|
|||||||
Reference in New Issue
Block a user