From a3b5444dd8e8a8e62323fb0d4c7ccf6ba78674f4 Mon Sep 17 00:00:00 2001 From: Aditi Date: Mon, 1 Feb 2021 14:25:04 +0000 Subject: [PATCH] Bug 1685809 - Removed expired Scalars telemetry.profile_directory_scans and telemetry.profile_directory_scan_date and Histogram PROFILE_DIRECTORY_FILE_AGE. r = chutten r=chutten Differential Revision: https://phabricator.services.mozilla.com/D103499 --- toolkit/components/telemetry/Histograms.json | 11 ------- toolkit/components/telemetry/Scalars.yaml | 34 -------------------- toolkit/modules/ProfileAge.jsm | 28 ---------------- 3 files changed, 73 deletions(-) diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 8498d61f34a7..72c245b675b0 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -15562,17 +15562,6 @@ "keyed": true, "description": "Permission requests (showing a permission prompt) by whether they were requested from code handling a user input event." }, - "PROFILE_DIRECTORY_FILE_AGE": { - "record_in_processes": ["main"], - "products": ["firefox", "fennec"], - "alert_emails": ["jrediger@mozilla.com", "telemetry-client-dev@mozilla.com"], - "bug_numbers": [1458574], - "expires_in_version": "65", - "high": 1500, - "n_buckets": 20, - "kind": "exponential", - "description": "Age of files scanned in profile directory in days when determining initial profile age." - }, "QUIRKS_MODE": { "record_in_processes": ["main", "content"], "products": ["firefox", "fennec"], diff --git a/toolkit/components/telemetry/Scalars.yaml b/toolkit/components/telemetry/Scalars.yaml index a6f657315166..e91acbed7476 100644 --- a/toolkit/components/telemetry/Scalars.yaml +++ b/toolkit/components/telemetry/Scalars.yaml @@ -3197,40 +3197,6 @@ telemetry: record_in_processes: - 'all' - profile_directory_scans: - bug_numbers: - - 1458574 - description: > - The number of times a profile directory scan was initiated in ProfileAge.jsm - expires: "65" - kind: uint - notification_emails: - - jrediger@mozilla.com - - telemetry-client-dev@mozilla.com - release_channel_collection: opt-out - products: - - 'firefox' - - 'fennec' - record_in_processes: - - 'all' - - profile_directory_scan_date: - bug_numbers: - - 1466518 - description: > - The date of the profile scan to determine the profile creation date from the oldest file, in days since UNIX epoch. - expires: "65" - kind: uint - notification_emails: - - jrediger@mozilla.com - - telemetry-client-dev@mozilla.com - release_channel_collection: opt-out - products: - - 'firefox' - - 'fennec' - record_in_processes: - - 'main' - data_upload_optin: bug_numbers: - 1445921 diff --git a/toolkit/modules/ProfileAge.jsm b/toolkit/modules/ProfileAge.jsm index bcecac9a6f58..4e49b48a1bfa 100644 --- a/toolkit/modules/ProfileAge.jsm +++ b/toolkit/modules/ProfileAge.jsm @@ -6,10 +6,6 @@ var EXPORTED_SYMBOLS = ["ProfileAge"]; -const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); -const { TelemetryUtils } = ChromeUtils.import( - "resource://gre/modules/TelemetryUtils.jsm" -); const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm"); const { Log } = ChromeUtils.import("resource://gre/modules/Log.jsm"); const { CommonUtils } = ChromeUtils.import( @@ -18,16 +14,6 @@ const { CommonUtils } = ChromeUtils.import( const FILE_TIMES = "times.json"; -/** - * Calculate how many days passed between two dates. - * @param {Object} aStartDate The starting date. - * @param {Object} aEndDate The ending date. - * @return {Integer} The number of days between the two dates. - */ -function getElapsedTimeInDays(aStartDate, aEndDate) { - return TelemetryUtils.millisecondsToDays(aEndDate - aStartDate); -} - /** * Traverse the contents of the profile directory, finding the oldest file * and returning its creation timestamp. @@ -43,11 +29,6 @@ async function getOldestProfileTimestamp(profilePath, log) { ); } - Services.telemetry.scalarAdd("telemetry.profile_directory_scans", 1); - let histogram = Services.telemetry.getHistogramById( - "PROFILE_DIRECTORY_FILE_AGE" - ); - try { await iterator.forEach(async entry => { try { @@ -67,11 +48,6 @@ async function getOldestProfileTimestamp(profilePath, log) { if (date) { let timestamp = date.getTime(); - // Get the age relative to now. - // We don't care about dates in the future. - let age_in_days = Math.max(0, getElapsedTimeInDays(timestamp, start)); - histogram.add(age_in_days); - log.debug("Using date: " + entry.path + " = " + date); if (timestamp < oldest) { oldest = timestamp; @@ -164,10 +140,6 @@ class ProfileAgeImpl { async computeAndPersistCreated() { let oldest = await getOldestProfileTimestamp(this.profilePath, this._log); this._times.created = oldest; - Services.telemetry.scalarSet( - "telemetry.profile_directory_scan_date", - TelemetryUtils.millisecondsToDays(Date.now()) - ); await this.writeTimes(); return oldest; }