From 34964f0ea6b83234e47396441ca3b8334dbf0daa Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sun, 8 May 2022 16:42:41 -0400 Subject: Remove telemetry more telemetry references --- app/nsBrowserApp.cpp | 6 -- app/profile/iceweasel-uxp.js | 8 +- base/content/aboutNetError.xhtml | 6 -- base/content/browser-data-submission-info-bar.js | 6 -- base/content/browser-fullScreenAndPointerLock.js | 5 -- base/content/browser-plugins.js | 27 +----- base/content/browser.js | 51 ------------ base/content/content.js | 6 -- base/content/newtab/sites.js | 19 ----- base/content/tabbrowser.xml | 92 +-------------------- base/content/urlbarBindings.xml | 10 --- components/migration/AutoMigrate.jsm | 32 ------- components/migration/FirefoxProfileMigrator.js | 71 +--------------- components/migration/MigrationUtils.jsm | 26 ------ components/migration/content/migration.js | 68 --------------- components/nsBrowserGlue.js | 1 - components/places/content/browserPlacesViews.js | 3 - components/places/content/places.js | 2 - components/preferences/in-content/content.js | 5 -- components/preferences/in-content/preferences.js | 34 -------- components/search/content/searchReset.js | 22 ----- components/search/service/nsSearchService.js | 24 ------ components/sessionstore/SessionFile.jsm | 27 ------ components/sessionstore/SessionStore.jsm | 33 +------- components/sessionstore/SessionWorker.js | 5 -- components/sessionstore/StartupPerformance.jsm | 12 --- .../sessionstore/content/content-sessionStore.js | 19 +---- components/sessionstore/nsSessionStartup.js | 5 -- installer/allowed-dupes.mn | 4 - installer/package-manifest.in | 4 - locales/en-US/chrome/browser/aboutDialog.dtd | 2 - locales/en-US/chrome/browser/browser.properties | 5 -- modules/ContentCrashHandlers.jsm | 18 ---- modules/ContentLinkHandler.jsm | 36 -------- modules/PermissionUI.jsm | 4 +- modules/PluginContent.jsm | 52 ------------ modules/ProcessHangMonitor.jsm | 11 --- themes/preprocess-tab-svgs.pyc | Bin 1213 -> 1125 bytes 38 files changed, 12 insertions(+), 749 deletions(-) diff --git a/app/nsBrowserApp.cpp b/app/nsBrowserApp.cpp index 5b51d35..1d985ca 100644 --- a/app/nsBrowserApp.cpp +++ b/app/nsBrowserApp.cpp @@ -32,7 +32,6 @@ #include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL #include "mozilla/Sprintf.h" -#include "mozilla/Telemetry.h" #include "mozilla/WindowsDllBlocklist.h" #if !defined(MOZ_WIDGET_COCOA) && !defined(MOZ_WIDGET_ANDROID) @@ -110,7 +109,6 @@ static bool IsArg(const char* arg, const char* s) XRE_GetFileFromPathType XRE_GetFileFromPath; XRE_CreateAppDataType XRE_CreateAppData; XRE_FreeAppDataType XRE_FreeAppData; -XRE_TelemetryAccumulateType XRE_TelemetryAccumulate; XRE_StartupTimelineRecordType XRE_StartupTimelineRecord; XRE_mainType XRE_main; XRE_StopLateWriteChecksType XRE_StopLateWriteChecks; @@ -128,8 +126,6 @@ static const nsDynamicFunctionLoad kXULFuncs[] = { { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath }, { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData }, { "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData }, - { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate }, - { "XRE_StartupTimelineRecord", (NSFuncPtr*) &XRE_StartupTimelineRecord }, { "XRE_main", (NSFuncPtr*) &XRE_main }, { "XRE_StopLateWriteChecks", (NSFuncPtr*) &XRE_StopLateWriteChecks }, { "XRE_XPCShellMain", (NSFuncPtr*) &XRE_XPCShellMain }, @@ -370,8 +366,6 @@ int main(int argc, char* argv[], char* envp[]) return 255; } - XRE_StartupTimelineRecord(mozilla::StartupTimeline::START, start); - #ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC XRE_EnableSameExecutableForContentProc(); #endif diff --git a/app/profile/iceweasel-uxp.js b/app/profile/iceweasel-uxp.js index b0fbcef..f5b75e9 100644 --- a/app/profile/iceweasel-uxp.js +++ b/app/profile/iceweasel-uxp.js @@ -1103,14 +1103,10 @@ pref("identity.mobilepromo.ios", ""); pref("ui.key.menuAccessKeyFocuses", true); #endif -// Play with different values of the decay time and get telemetry, +// Play with different values of the decay time, // 0 means to randomize (and persist) the experiment value in users' profiles, // -1 means no experiment is run and we use the preferred value for frecency (6h) -pref("browser.cache.frecency_experiment", 0); - -// Telemetry settings. -// Determines if Telemetry pings can be archived locally. -pref("toolkit.telemetry.archive.enabled", false); +pref("browser.cache.frecency_experiment", -1); // Enable GMP support in the addon manager. pref("media.gmp-provider.enabled", false); diff --git a/base/content/aboutNetError.xhtml b/base/content/aboutNetError.xhtml index 1502a9b..952a1d5 100644 --- a/base/content/aboutNetError.xhtml +++ b/base/content/aboutNetError.xhtml @@ -130,12 +130,6 @@ var div = document.getElementById("certificateErrorDebugInformation"); div.style.display = "none"; } - - if (panel.style.display == "block") { - // send event to trigger telemetry ping - var event = new CustomEvent("AboutNetErrorUIExpanded", {bubbles:true}); - document.dispatchEvent(event); - } }); if (allowOverride) { diff --git a/base/content/browser-data-submission-info-bar.js b/base/content/browser-data-submission-info-bar.js index 0c87d19..bb76903 100644 --- a/base/content/browser-data-submission-info-bar.js +++ b/base/content/browser-data-submission-info-bar.js @@ -2,9 +2,6 @@ * 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/. */ -const LOGGER_NAME = "Toolkit.Telemetry"; -const LOGGER_PREFIX = "DataNotificationInfoBar::"; - /** * Represents an info bar that shows a data submission notification. */ @@ -22,9 +19,6 @@ var gDataNotificationInfoBar = { }, get _log() { - let Log = Cu.import("resource://gre/modules/Log.jsm", {}).Log; - delete this._log; - return this._log = Log.repository.getLoggerWithMessagePrefix(LOGGER_NAME, LOGGER_PREFIX); }, init: function() { diff --git a/base/content/browser-fullScreenAndPointerLock.js b/base/content/browser-fullScreenAndPointerLock.js index ebe5537..f4f0514 100644 --- a/base/content/browser-fullScreenAndPointerLock.js +++ b/base/content/browser-fullScreenAndPointerLock.js @@ -348,11 +348,6 @@ var FullScreen = { // TabsInTitlebar._update() and bug 1173768. TabsInTitlebar.updateAppearance(true); } - - if (enterFS && !document.fullscreenElement) { - Services.telemetry.getHistogramById("FX_BROWSER_FULLSCREEN_USED") - .add(1); - } }, exitDomFullScreen : function() { diff --git a/base/content/browser-plugins.js b/base/content/browser-plugins.js index c1bc658..5b043d1 100644 --- a/base/content/browser-plugins.js +++ b/base/content/browser-plugins.js @@ -111,18 +111,7 @@ var gPluginHandler = { }, _clickToPlayNotificationEventCallback: function PH_ctpEventCallback(event) { - if (event == "showing") { - Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_SHOWN") - .add(!this.options.primaryPlugin); - // Histograms always start at 0, even though our data starts at 1 - let histogramCount = this.options.pluginData.size - 1; - if (histogramCount > 4) { - histogramCount = 4; - } - Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_PLUGIN_COUNT") - .add(histogramCount); - } - else if (event == "dismissed") { + if (event == "dismissed") { // Once the popup is dismissed, clicking the icon should show the full // list again this.options.primaryPlugin = null; @@ -138,8 +127,6 @@ var gPluginHandler = { let permission; let expireType; let expireTime; - let histogram = - Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_USER_ACTION"); // Update the permission manager. // Also update the current state of pluginInfo.fallbackType so that @@ -149,7 +136,6 @@ var gPluginHandler = { permission = Ci.nsIPermissionManager.ALLOW_ACTION; expireType = Ci.nsIPermissionManager.EXPIRE_SESSION; expireTime = Date.now() + Services.prefs.getIntPref(this.PREF_SESSION_PERSIST_MINUTES) * 60 * 1000; - histogram.add(0); aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE; break; @@ -158,7 +144,6 @@ var gPluginHandler = { expireType = Ci.nsIPermissionManager.EXPIRE_TIME; expireTime = Date.now() + Services.prefs.getIntPref(this.PREF_PERSISTENT_DAYS) * 24 * 60 * 60 * 1000; - histogram.add(1); aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE; break; @@ -166,7 +151,6 @@ var gPluginHandler = { permission = Ci.nsIPermissionManager.PROMPT_ACTION; expireType = Ci.nsIPermissionManager.EXPIRE_NEVER; expireTime = 0; - histogram.add(2); switch (aPluginInfo.blocklistState) { case Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE: aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_VULNERABLE_UPDATABLE; @@ -347,9 +331,6 @@ var gPluginHandler = { return; } - Services.telemetry.getHistogramById("PLUGINS_INFOBAR_SHOWN"). - add(true); - let message; // Icons set directly cannot be manipulated using moz-image-region, so // we use CSS classes instead. @@ -386,9 +367,6 @@ var gPluginHandler = { label: gNavigatorBundle.getString("pluginContinueBlocking.label"), accessKey: gNavigatorBundle.getString("pluginContinueBlocking.accesskey"), callback: function() { - Services.telemetry.getHistogramById("PLUGINS_INFOBAR_BLOCK"). - add(true); - Services.perms.addFromPrincipal(principal, "plugin-hidden-notification", Services.perms.DENY_ACTION); @@ -398,9 +376,6 @@ var gPluginHandler = { label: gNavigatorBundle.getString("pluginActivateTrigger.label"), accessKey: gNavigatorBundle.getString("pluginActivateTrigger.accesskey"), callback: function() { - Services.telemetry.getHistogramById("PLUGINS_INFOBAR_ALLOW"). - add(true); - let curNotification = PopupNotifications.getNotification("click-to-play-plugins", browser); diff --git a/base/content/browser.js b/base/content/browser.js index 352f5e6..58a57be 100755 --- a/base/content/browser.js +++ b/base/content/browser.js @@ -1041,10 +1041,6 @@ var gBrowserInit = { _delayedStartup: function() { let tmp = {}; - Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", tmp); - let TelemetryTimestamps = tmp.TelemetryTimestamps; - TelemetryTimestamps.add("delayedStartupStarted"); - this._cancelDelayedStartup(); // We need to set the OfflineApps message listeners up before we @@ -1186,8 +1182,6 @@ var gBrowserInit = { PanelUI.init(); LightweightThemeListener.init(); - Services.telemetry.getHistogramById("E10S_WINDOW").add(gMultiProcessBrowser); - SidebarUI.startDelayedLoad(); UpdateUrlbarSearchSplitterState(); @@ -1345,23 +1339,6 @@ var gBrowserInit = { // Start monitoring slow add-ons AddonWatcher.init(); - // Telemetry for master-password - we do this after 5 seconds as it - // can cause IO if NSS/PSM has not already initialized. - setTimeout(() => { - if (window.closed) { - return; - } - let secmodDB = Cc["@mozilla.org/security/pkcs11moduledb;1"] - .getService(Ci.nsIPKCS11ModuleDB); - let slot = secmodDB.findSlotByName(""); - let mpEnabled = slot && - slot.status != Ci.nsIPKCS11Slot.SLOT_UNINITIALIZED && - slot.status != Ci.nsIPKCS11Slot.SLOT_READY; - if (mpEnabled) { - Services.telemetry.getHistogramById("MASTER_PASSWORD_ENABLED").add(mpEnabled); - } - }, 5000); - PanicButtonNotifier.init(); }); @@ -1376,7 +1353,6 @@ var gBrowserInit = { this.delayedStartupFinished = true; Services.obs.notifyObservers(window, "browser-delayed-startup-finished", ""); - TelemetryTimestamps.add("delayedStartupFinished"); }, // Returns the URI(s) to load at startup. @@ -2659,12 +2635,6 @@ var gMenuButtonUpdateBadge = { } }; -// Values for telemtery bins: see TLS_ERROR_REPORT_UI in Histograms.json -const TLS_ERROR_REPORT_TELEMETRY_AUTO_CHECKED = 2; -const TLS_ERROR_REPORT_TELEMETRY_AUTO_UNCHECKED = 3; -const TLS_ERROR_REPORT_TELEMETRY_MANUAL_SEND = 4; -const TLS_ERROR_REPORT_TELEMETRY_AUTO_SEND = 5; - const PREF_SSL_IMPACT_ROOTS = ["security.tls.version.", "security.ssl3."]; const PREF_SSL_IMPACT = PREF_SSL_IMPACT_ROOTS.reduce((prefs, root) => { @@ -2684,7 +2654,6 @@ var BrowserOnClick = { mm.addMessageListener("Browser:SiteBlockedError", this); mm.addMessageListener("Browser:EnableOnlineMode", this); mm.addMessageListener("Browser:ResetSSLPreferences", this); - mm.addMessageListener("Browser:SSLErrorReportTelemetry", this); mm.addMessageListener("Browser:OverrideWeakCrypto", this); mm.addMessageListener("Browser:SSLErrorGoBack", this); @@ -2698,7 +2667,6 @@ var BrowserOnClick = { mm.removeMessageListener("Browser:SiteBlockedError", this); mm.removeMessageListener("Browser:EnableOnlineMode", this); mm.removeMessageListener("Browser:ResetSSLPreferences", this); - mm.removeMessageListener("Browser:SSLErrorReportTelemetry", this); mm.removeMessageListener("Browser:OverrideWeakCrypto", this); mm.removeMessageListener("Browser:SSLErrorGoBack", this); @@ -2744,11 +2712,6 @@ var BrowserOnClick = { } msg.target.reload(); break; - case "Browser:SSLErrorReportTelemetry": - let reportStatus = msg.data.reportStatus; - Services.telemetry.getHistogramById("TLS_ERROR_REPORT_UI") - .add(reportStatus); - break; case "Browser:OverrideWeakCrypto": let weakCryptoOverride = Cc["@mozilla.org/security/weakcryptooverride;1"] .getService(Ci.nsIWeakCryptoOverride); @@ -4898,11 +4861,6 @@ var gTabletModePageCounter = { }, finish() { - if (this.enabled) { - let histogram = Services.telemetry.getKeyedHistogramById("FX_TABLETMODE_PAGE_LOAD"); - histogram.add("tablet", this._tabletCount); - histogram.add("desktop", this._desktopCount); - } }, }; @@ -6433,12 +6391,6 @@ var gIdentityHandler = { }, disableMixedContentProtection() { - // Use telemetry to measure how often unblocking happens - const kMIXED_CONTENT_UNBLOCK_EVENT = 2; - let histogram = - Services.telemetry.getHistogramById( - "MIXED_CONTENT_UNBLOCK_COUNTER"); - histogram.add(kMIXED_CONTENT_UNBLOCK_EVENT); // Reload the page with the content unblocked BrowserReloadWithFlags( Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT); @@ -7155,9 +7107,6 @@ var gIdentityHandler = { this._permissionJustRemoved = true; this.updatePermissionHint(); - // Set telemetry values for clearing a permission - let histogram = Services.telemetry.getKeyedHistogramById("WEB_PERMISSION_CLEARED"); - let permissionType = 0; if (aPermission.state == SitePermissions.ALLOW) { // 1 : clear permanently allowed permission diff --git a/base/content/content.js b/base/content/content.js index e21cedf..26c30a9 100644 --- a/base/content/content.js +++ b/base/content/content.js @@ -216,12 +216,6 @@ Cc["@mozilla.org/eventlistenerservice;1"] .getService(Ci.nsIEventListenerService) .addSystemEventListener(global, "contextmenu", handleContentContextMenu, false); -// Values for telemtery bins: see TLS_ERROR_REPORT_UI in Histograms.json -const TLS_ERROR_REPORT_TELEMETRY_UI_SHOWN = 0; -const TLS_ERROR_REPORT_TELEMETRY_EXPANDED = 1; -const TLS_ERROR_REPORT_TELEMETRY_SUCCESS = 6; -const TLS_ERROR_REPORT_TELEMETRY_FAILURE = 7; - const SEC_ERROR_BASE = Ci.nsINSSErrorsService.NSS_SEC_ERROR_BASE; const MOZILLA_PKIX_ERROR_BASE = Ci.nsINSSErrorsService.MOZILLA_PKIX_ERROR_BASE; diff --git a/base/content/newtab/sites.js b/base/content/newtab/sites.js index 1ede993..a3d0160 100644 --- a/base/content/newtab/sites.js +++ b/base/content/newtab/sites.js @@ -280,21 +280,6 @@ Site.prototype = { } catch (e) {} }, - /** - * Record interaction with site using telemetry. - */ - _recordSiteClicked: function Site_recordSiteClicked(aIndex) { - if (Services.prefs.prefHasUserValue("browser.newtabpage.rows") || - Services.prefs.prefHasUserValue("browser.newtabpage.columns") || - aIndex > 8) { - // We only want to get indices for the default configuration, everything - // else goes in the same bucket. - aIndex = 9; - } - Services.telemetry.getHistogramById("NEWTAB_PAGE_SITE_CLICKED") - .add(aIndex); - }, - /** * Handles site click events. */ @@ -306,10 +291,6 @@ Site.prototype = { // Handle tile/thumbnail link click if (target.classList.contains("newtab-link") || target.parentElement.classList.contains("newtab-link")) { - // Record for primary and middle clicks - if (button == 0 || button == 1) { - this._recordSiteClicked(tileIndex); - } } // Only handle primary clicks for the remaining targets else if (button == 0) { diff --git a/base/content/tabbrowser.xml b/base/content/tabbrowser.xml index 3b17718..c6202d2 100644 --- a/base/content/tabbrowser.xml +++ b/base/content/tabbrowser.xml @@ -1310,8 +1310,7 @@ This function assumes we have an LRU cache of tabs (either images of tab content or their layers). The goal is to find out how far into the cache we need to look in order to find - aTab. We record this number in telemetry and also move aTab to - the front of the cache. + aTab. We move aTab to the front of the cache. A newly created tab has position Infinity in the cache. If a tab is closed, it has no effect on the position of other @@ -1323,10 +1322,6 @@ @@ -2249,8 +2240,6 @@ if (animate) { requestAnimationFrame(function () { - this.tabContainer._handleTabTelemetryStart(t, aURI); - // kick the animation off t.setAttribute("fadein", "true"); }.bind(this)); @@ -2434,8 +2423,6 @@ return; } - this.tabContainer._handleTabTelemetryStart(aTab); - this._blurTab(aTab); aTab.style.maxWidth = ""; // ensure that fade-out transition happens aTab.removeAttribute("fadein"); @@ -5858,81 +5845,6 @@ - - - - - - - - - - - - 1) { - let averageInterval = 0; - for (let i = 1; i < frameCount; i++) { - averageInterval += intervals[i]; - } - averageInterval = averageInterval / (frameCount - 1); - - Services.telemetry.getHistogramById("FX_TAB_ANIM_ANY_FRAME_INTERVAL_MS").add(averageInterval); - - if (aTab._recordingTabOpenPlain) { - delete aTab._recordingTabOpenPlain; - // While we do have a telemetry probe NEWTAB_PAGE_ENABLED to monitor newtab preview, it'll be - // easier to overview the data without slicing by it. Hence the additional histograms with _PREVIEW. - let preview = this._browserNewtabpageEnabled ? "_PREVIEW" : ""; - Services.telemetry.getHistogramById("FX_TAB_ANIM_OPEN" + preview + "_FRAME_INTERVAL_MS").add(averageInterval); - } - } - ]]> - - - @@ -5947,8 +5859,6 @@ var tab = event.target; - this._handleTabTelemetryEnd(tab); - if (tab.getAttribute("fadein") == "true") { if (tab._fullyOpen) this.adjustTabstrip(); diff --git a/base/content/urlbarBindings.xml b/base/content/urlbarBindings.xml index b2a1f32..4ff1e66 100644 --- a/base/content/urlbarBindings.xml +++ b/base/content/urlbarBindings.xml @@ -601,7 +601,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. typeof(engineOrEngineName) == "string" ? Services.search.getEngineByName(engineOrEngineName) : engineOrEngineName; - let isOneOff = this.popup.oneOffSearchButtons; // Infer the type of the event which triggered the search. let eventType = "unknown"; if (event instanceof KeyboardEvent) { @@ -611,7 +610,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. } // Augment the search action details object. let details = searchActionDetails || {}; - details.isOneOff = isOneOff; details.type = eventType; let submission = engine.getSubmission(query, null, "keyword"); @@ -1287,12 +1285,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. var searchBar = BrowserSearch.searchBar; var popupForSearchBar = searchBar && searchBar.textbox == this.mInput; - if (popupForSearchBar) { - searchBar.telemetrySearchDetails = { - index: controller.selection.currentIndex, - kind: "mouse" - }; - } // Check for unmodified left-click, and use default behavior if (aEvent.button == 0 && !aEvent.shiftKey && !aEvent.ctrlKey && @@ -1435,12 +1427,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. { if (topic == "Migration:ItemError") { sawErrors = true; } else if (topic == "Migration:Ended") { - histogram.add(25); - if (sawErrors) { - histogram.add(26); - } Services.obs.removeObserver(migrationObserver, "Migration:Ended"); Services.obs.removeObserver(migrationObserver, "Migration:ItemError"); Services.prefs.setCharPref(kAutoMigrateBrowserPref, pickedKey); @@ -132,7 +122,6 @@ const AutoMigrate = { Services.obs.addObserver(migrationObserver, "Migration:Ended", false); Services.obs.addObserver(migrationObserver, "Migration:ItemError", false); migrator.migrate(this.resourceTypesToUse, profileStartup, profileToMigrate); - histogram.add(20); }, /** @@ -209,50 +198,35 @@ const AutoMigrate = { undo: Task.async(function* () { let browserId = Preferences.get(kAutoMigrateBrowserPref, "unknown"); - let histogram = Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_UNDO"); - histogram.add(0); if (!(yield this.canUndo())) { - histogram.add(5); throw new Error("Can't undo!"); } this._pendingUndoTasks = true; this._removeNotificationBars(); - histogram.add(10); let readPromise = OS.File.read(kUndoStateFullPath, { encoding: "utf-8", compression: "lz4", }); let stateData = this._dejsonifyUndoState(yield readPromise); - histogram.add(12); this._errorMap = {bookmarks: 0, visits: 0, logins: 0}; - let reportErrorTelemetry = (type) => { - let histogramId = `FX_STARTUP_MIGRATION_UNDO_${type.toUpperCase()}_ERRORCOUNT`; - Services.telemetry.getKeyedHistogramById(histogramId).add(browserId, this._errorMap[type]); - }; yield this._removeUnchangedBookmarks(stateData.get("bookmarks")).catch(ex => { Cu.reportError("Uncaught exception when removing unchanged bookmarks!"); Cu.reportError(ex); }); - reportErrorTelemetry("bookmarks"); - histogram.add(15); yield this._removeSomeVisits(stateData.get("visits")).catch(ex => { Cu.reportError("Uncaught exception when removing history visits!"); Cu.reportError(ex); }); - reportErrorTelemetry("visits"); - histogram.add(20); yield this._removeUnchangedLogins(stateData.get("logins")).catch(ex => { Cu.reportError("Uncaught exception when removing unchanged logins!"); Cu.reportError(ex); }); - reportErrorTelemetry("logins"); - histogram.add(25); // This is async, but no need to wait for it. NewTabUtils.links.populateCache(() => { @@ -260,7 +234,6 @@ const AutoMigrate = { }, true); this._purgeUndoState(this.UNDO_REMOVED_REASON_UNDO_USED); - histogram.add(30); }), _removeNotificationBars() { @@ -288,10 +261,6 @@ const AutoMigrate = { let migrationBrowser = Preferences.get(kAutoMigrateBrowserPref, "unknown"); Services.prefs.clearUserPref(kAutoMigrateBrowserPref); - - let histogram = - Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_UNDO_REASON"); - histogram.add(migrationBrowser, reason); }, getBrowserUsedForMigration() { @@ -367,7 +336,6 @@ const AutoMigrate = { message, kNotificationId, null, notificationBox.PRIORITY_INFO_HIGH, buttons ); let remainingDays = Preferences.get(kAutoMigrateDaysToOfferUndoPref, 0); - Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_UNDO_OFFERED").add(4 - remainingDays); }), shouldStillShowUndoPrompt() { diff --git a/components/migration/FirefoxProfileMigrator.js b/components/migration/FirefoxProfileMigrator.js index f0339f6..c88ce0d 100644 --- a/components/migration/FirefoxProfileMigrator.js +++ b/components/migration/FirefoxProfileMigrator.js @@ -170,77 +170,8 @@ FirefoxProfileMigrator.prototype._getResourcesInternal = function(sourceProfileD }; } - // Telemetry related migrations. - let times = { - name: "times", // name is used only by tests. - type: types.OTHERDATA, - migrate: aCallback => { - let file = this._getFileObject(sourceProfileDir, "times.json"); - if (file) { - file.copyTo(currentProfileDir, ""); - } - // And record the fact a migration (ie, a reset) happened. - let timesAccessor = new ProfileAge(currentProfileDir.path); - timesAccessor.recordProfileReset().then( - () => aCallback(true), - () => aCallback(false) - ); - } - }; - let telemetry = { - name: "telemetry", // name is used only by tests... - type: types.OTHERDATA, - migrate: aCallback => { - let createSubDir = (name) => { - let dir = currentProfileDir.clone(); - dir.append(name); - dir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY); - return dir; - }; - - // If the 'datareporting' directory exists we migrate files from it. - let haveStateFile = false; - let dataReportingDir = this._getFileObject(sourceProfileDir, "datareporting"); - if (dataReportingDir && dataReportingDir.isDirectory()) { - // Copy only specific files. - let toCopy = ["state.json", "session-state.json"]; - - let dest = createSubDir("datareporting"); - let enumerator = dataReportingDir.directoryEntries; - while (enumerator.hasMoreElements()) { - let file = enumerator.getNext().QueryInterface(Ci.nsIFile); - if (file.isDirectory() || toCopy.indexOf(file.leafName) == -1) { - continue; - } - - if (file.leafName == "state.json") { - haveStateFile = true; - } - file.copyTo(dest, ""); - } - } - - if (!haveStateFile) { - // Fall back to migrating the state file that contains the client id from healthreport/. - // We first moved the client id management from the FHR implementation to the datareporting - // service. - // Consequently, we try to migrate an existing FHR state file here as a fallback. - let healthReportDir = this._getFileObject(sourceProfileDir, "healthreport"); - if (healthReportDir && healthReportDir.isDirectory()) { - let stateFile = this._getFileObject(healthReportDir, "state.json"); - if (stateFile) { - let dest = createSubDir("healthreport"); - stateFile.copyTo(dest, ""); - } - } - } - - aCallback(true); - } - }; - return [places, cookies, passwords, formData, dictionary, bookmarksBackups, - session, times, telemetry].filter(r => r); + session].filter(r => r); }; Object.defineProperty(FirefoxProfileMigrator.prototype, "startupOnlyMigrator", { diff --git a/components/migration/MigrationUtils.jsm b/components/migration/MigrationUtils.jsm index 752e752..e40b437 100644 --- a/components/migration/MigrationUtils.jsm +++ b/components/migration/MigrationUtils.jsm @@ -265,27 +265,6 @@ this.MigratorPrototype = { let maybeFinishResponsivenessMonitor = (responsivenessMonitor, histogramId) => { if (responsivenessMonitor) { let accumulatedDelay = responsivenessMonitor.finish(); - if (histogramId) { - try { - Services.telemetry.getKeyedHistogramById(histogramId) - .add(browserKey, accumulatedDelay); - } catch (ex) { - Cu.reportError(histogramId + ": " + ex); - } - } - } - }; - - let collectQuantityTelemetry = () => { - for (let resourceType of Object.keys(MigrationUtils._importQuantities)) { - let histogramId = - "FX_MIGRATION_" + resourceType.toUpperCase() + "_QUANTITY"; - try { - Services.telemetry.getKeyedHistogramById(histogramId) - .add(browserKey, MigrationUtils._importQuantities[resourceType]); - } catch (ex) { - Cu.reportError(histogramId + ": " + ex); - } } }; @@ -331,7 +310,6 @@ this.MigratorPrototype = { maybeFinishResponsivenessMonitor(responsivenessMonitor, responsivenessHistogramId); if (resourcesGroupedByItems.size == 0) { - collectQuantityTelemetry(); notify("Migration:Ended"); } } @@ -803,7 +781,6 @@ this.MigrationUtils = Object.freeze({ * - {String} an identifier for the profile to use when migrating * NB: If you add new consumers, please add a migration entry point * constant below, and specify at least the first element of the array - * (the migration entry point for purposes of telemetry). */ showMigrationWizard: function MU_showMigrationWizard(aOpener, aParams) { @@ -1096,7 +1073,4 @@ this.MigrationUtils = Object.freeze({ "safari": 8, "360se": 9, }, - getSourceIdForTelemetry(sourceName) { - return this._sourceNameToIdMapping[sourceName] || 0; - }, }); diff --git a/components/migration/content/migration.js b/components/migration/content/migration.js index eb21756..cfdf48f 100644 --- a/components/migration/content/migration.js +++ b/components/migration/content/migration.js @@ -35,7 +35,6 @@ var MigrationWizard = { /* exported MigrationWizard */ let args = window.arguments; let entryPointId = args[0] || MigrationUtils.MIGRATION_ENTRYPOINT_UNKNOWN; - Services.telemetry.getHistogramById("FX_MIGRATION_ENTRY_POINT").add(entryPointId); this.isInitialMigration = entryPointId == MigrationUtils.MIGRATION_ENTRYPOINT_FIRSTRUN; if (args.length > 1) { @@ -105,15 +104,6 @@ var MigrationWizard = { /* exported MigrationWizard */ } } } - if (this.isInitialMigration) { - Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_BROWSER_COUNT") - .add(this._availableMigrators.length); - let defaultBrowser = MigrationUtils.getMigratorKeyForDefaultBrowser(); - // This will record 0 for unknown default browser IDs. - defaultBrowser = MigrationUtils.getSourceIdForTelemetry(defaultBrowser); - Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_EXISTING_DEFAULT_BROWSER") - .add(defaultBrowser); - } group.addEventListener("command", toggleCloseBrowserWarning); @@ -142,11 +132,6 @@ var MigrationWizard = { /* exported MigrationWizard */ var newSource = document.getElementById("importSourceGroup").selectedItem.id; if (newSource == "nothing") { - // Need to do telemetry here because we're closing the dialog before we get to - // do actual migration. For actual migration, this doesn't happen until after - // migration takes place. - Services.telemetry.getHistogramById("FX_MIGRATION_SOURCE_BROWSER") - .add(MigrationUtils.getSourceIdForTelemetry("nothing")); document.documentElement.cancel(); return false; } @@ -366,21 +351,6 @@ var MigrationWizard = { /* exported MigrationWizard */ onMigratingMigrate: function () { this._migrator.migrate(this._itemsFlags, this._autoMigrate, this._selectedProfile); - - Services.telemetry.getHistogramById("FX_MIGRATION_SOURCE_BROWSER") - .add(MigrationUtils.getSourceIdForTelemetry(this._source)); - if (!this._autoMigrate) { - let hist = Services.telemetry.getKeyedHistogramById("FX_MIGRATION_USAGE"); - let exp = 0; - let items = this._itemsFlags; - while (items) { - if (items & 1) { - hist.add(this._source, exp); - } - items = items >> 1; - exp++; - } - } }, _listItems: function (aID) @@ -426,18 +396,8 @@ var MigrationWizard = { /* exported MigrationWizard */ label.removeAttribute("style"); break; case "Migration:Ended": - if (this.isInitialMigration) { - // Ensure errors in reporting data recency do not affect the rest of the migration. - try { - this.reportDataRecencyTelemetry(); - } catch (ex) { - Cu.reportError(ex); - } - } if (this._autoMigrate) { let hasImportedHomepage = !!(this._newHomePage && this._newHomePage != "DEFAULT"); - Services.telemetry.getKeyedHistogramById("FX_MIGRATION_IMPORTED_HOMEPAGE") - .add(this._source, hasImportedHomepage); if (this._newHomePage) { try { // set homepage properly @@ -508,8 +468,6 @@ var MigrationWizard = { /* exported MigrationWizard */ Cc["@mozilla.org/consoleservice;1"] .getService(Ci.nsIConsoleService) .logStringMessage("some " + type + " did not successfully migrate."); - Services.telemetry.getKeyedHistogramById("FX_MIGRATION_ERRORS") - .add(this._source, Math.log2(numericType)); break; } }, @@ -520,30 +478,4 @@ var MigrationWizard = { /* exported MigrationWizard */ this._wiz.canRewind = false; this._listItems("doneItems"); }, - - reportDataRecencyTelemetry() { - let histogram = Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_DATA_RECENCY"); - let lastUsedPromises = []; - for (let [key, migrator] of this._availableMigrators) { - // No block-scoped let in for...of loop conditions, so get the source: - let localKey = key; - lastUsedPromises.push(migrator.getLastUsedDate().then(date => { - const ONE_YEAR = 24 * 365; - let diffInHours = Math.round((Date.now() - date) / (60 * 60 * 1000)); - if (diffInHours > ONE_YEAR) { - diffInHours = ONE_YEAR; - } - histogram.add(localKey, diffInHours); - return [localKey, diffInHours]; - })); - } - Promise.all(lastUsedPromises).then(migratorUsedTimeDiff => { - // Sort low to high. - migratorUsedTimeDiff.sort(([keyA, diffA], [keyB, diffB]) => diffA - diffB); /* eslint no-unused-vars: off */ - let usedMostRecentBrowser = migratorUsedTimeDiff.length && this._source == migratorUsedTimeDiff[0][0]; - let usedRecentBrowser = - Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_USED_RECENT_BROWSER"); - usedRecentBrowser.add(this._source, usedMostRecentBrowser); - }); - }, }; diff --git a/components/nsBrowserGlue.js b/components/nsBrowserGlue.js index 8d66c47..211b16c 100644 --- a/components/nsBrowserGlue.js +++ b/components/nsBrowserGlue.js @@ -306,7 +306,6 @@ BrowserGlue.prototype = { } catch (ex) { Cu.reportError(ex); } - let win = RecentWindow.getMostRecentBrowserWindow(); break; case "browser-search-engine-modified": // Ensure we cleanup the hiddenOneOffs pref when removing diff --git a/components/places/content/browserPlacesViews.js b/components/places/content/browserPlacesViews.js index c6ee9b6..bab8825 100644 --- a/components/places/content/browserPlacesViews.js +++ b/components/places/content/browserPlacesViews.js @@ -980,9 +980,6 @@ function PlacesToolbar(aPlace) { } PlacesViewBase.call(this, aPlace); - - Services.telemetry.getHistogramById("FX_BOOKMARKS_TOOLBAR_INIT_MS") - .add(Date.now() - startTime); } PlacesToolbar.prototype = { diff --git a/components/places/content/places.js b/components/places/content/places.js index 375c3de..529f192 100644 --- a/components/places/content/places.js +++ b/components/places/content/places.js @@ -17,7 +17,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "DownloadUtils", "resource://gre/modules/DownloadUtils.jsm"); const RESTORE_FILEPICKER_FILTER_EXT = "*.json;*.jsonlz4"; -const HISTORY_LIBRARY_SEARCH_TELEMETRY = "PLACES_HISTORY_LIBRARY_SEARCH_TIME_MS"; var PlacesOrganizer = { _places: null, @@ -360,7 +359,6 @@ var PlacesOrganizer = { * cookies, history, preferences, and bookmarks. */ importFromBrowser: function PO_importFromBrowser() { - // We pass in the type of source we're using for use in telemetry: MigrationUtils.showMigrationWizard(window, [MigrationUtils.MIGRATION_ENTRYPOINT_PLACES]); }, diff --git a/components/preferences/in-content/content.js b/components/preferences/in-content/content.js index a2a3e8a..d0423bf 100644 --- a/components/preferences/in-content/content.js +++ b/components/preferences/in-content/content.js @@ -101,11 +101,6 @@ var gContentPane = { gSubDialog.open("chrome://browser/content/preferences/permissions.xul", "resizable=yes", params); - - try { - Services.telemetry - .getHistogramById("WEB_NOTIFICATION_EXCEPTIONS_OPENED").add(); - } catch (e) {} }, diff --git a/components/preferences/in-content/preferences.js b/components/preferences/in-content/preferences.js index 69cb180..f6a6941 100644 --- a/components/preferences/in-content/preferences.js +++ b/components/preferences/in-content/preferences.js @@ -124,36 +124,6 @@ function init_dynamic_padding() { document.documentElement.appendChild(mediaStyle); } -function telemetryBucketForCategory(category) { - switch (category) { - case "general": - case "search": - case "content": - case "applications": - case "privacy": - case "security": - case "sync": - return category; - case "advanced": - let advancedPaneTabs = document.getElementById("advancedPrefs"); - switch (advancedPaneTabs.selectedTab.id) { - case "generalTab": - return "advancedGeneral"; - case "dataChoicesTab": - return "advancedDataChoices"; - case "networkTab": - return "advancedNetwork"; - case "updateTab": - return "advancedUpdates"; - case "encryptionTab": - return "advancedCerts"; - } - // fall-through for unknown. - default: - return "unknown"; - } -} - function onHashChange() { gotoPref(); } @@ -194,10 +164,6 @@ function gotoPref(aCategory) { search(category, "data-category"); let mainContent = document.querySelector(".main-content"); mainContent.scrollTop = 0; - - Services.telemetry - .getHistogramById("FX_PREFERENCES_CATEGORY_OPENED") - .add(telemetryBucketForCategory(friendlyName)); } function search(aQuery, aAttribute) { diff --git a/components/search/content/searchReset.js b/components/search/content/searchReset.js index b541d41..bb01233 100644 --- a/components/search/content/searchReset.js +++ b/components/search/content/searchReset.js @@ -8,14 +8,6 @@ var {classes: Cc, interfaces: Ci, utils: Cu} = Components; Cu.import("resource://gre/modules/Services.jsm"); -const TELEMETRY_RESULT_ENUM = { - RESTORED_DEFAULT: 0, - KEPT_CURRENT: 1, - CHANGED_ENGINE: 2, - CLOSED_PAGE: 3, - OPENED_SETTINGS: 4 -}; - window.onload = function() { let defaultEngine = document.getElementById("defaultEngine"); let originalDefault = Services.search.originalDefaultEngine; @@ -24,9 +16,6 @@ window.onload = function() { 'url("' + originalDefault.iconURI.spec + '")'; document.getElementById("searchResetChangeEngine").focus(); - window.addEventListener("unload", recordPageClosed); - document.getElementById("linkSettingsPage") - .addEventListener("click", openingSettings); }; function doSearch() { @@ -46,8 +35,6 @@ function doSearch() { let engine = Services.search.currentEngine; let submission = engine.getSubmission(queryString, null, purpose); - window.removeEventListener("unload", recordPageClosed); - let win = window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIDocShellTreeItem) @@ -58,8 +45,6 @@ function doSearch() { } function openingSettings() { - record(TELEMETRY_RESULT_ENUM.OPENED_SETTINGS); - window.removeEventListener("unload", recordPageClosed); } function record(result) { @@ -70,7 +55,6 @@ function keepCurrentEngine() { // Calling the currentEngine setter will force a correct loadPathHash to be // written for this engine, so that we don't prompt the user again. Services.search.currentEngine = Services.search.currentEngine; - record(TELEMETRY_RESULT_ENUM.KEPT_CURRENT); doSearch(); } @@ -80,11 +64,5 @@ function changeSearchEngine() { engine.hidden = false; Services.search.currentEngine = engine; - record(TELEMETRY_RESULT_ENUM.RESTORED_DEFAULT); - doSearch(); } - -function recordPageClosed() { - record(TELEMETRY_RESULT_ENUM.CLOSED_PAGE); -} diff --git a/components/search/service/nsSearchService.js b/components/search/service/nsSearchService.js index b4db31d..aaa719e 100644 --- a/components/search/service/nsSearchService.js +++ b/components/search/service/nsSearchService.js @@ -2309,8 +2309,6 @@ SearchService.prototype = { this._initObservers.resolve(this._initRV); Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete"); - Services.telemetry.getHistogramById("SEARCH_SERVICE_INIT_SYNC").add(true); - this._recordEngineTelemetry(); LOG("_syncInit end"); }, @@ -2348,8 +2346,6 @@ SearchService.prototype = { this._cacheFileJSON = null; this._initObservers.resolve(this._initRV); Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete"); - Services.telemetry.getHistogramById("SEARCH_SERVICE_INIT_SYNC").add(false); - this._recordEngineTelemetry(); LOG("_asyncInit: Completed _asyncInit"); }), @@ -2715,7 +2711,6 @@ SearchService.prototype = { // Typically we'll re-init as a result of a pref observer, // so signal to 'callers' that we're done. Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete"); - this._recordEngineTelemetry(); gInitialized = true; } catch (err) { LOG("Reinit failed: " + err); @@ -3892,25 +3887,6 @@ SearchService.prototype = { return result; }, - _recordEngineTelemetry: function() { - Services.telemetry.getHistogramById("SEARCH_SERVICE_ENGINE_COUNT") - .add(Object.keys(this._engines).length); - let hasUpdates = false; - let hasIconUpdates = false; - for (let name in this._engines) { - let engine = this._engines[name]; - if (engine._hasUpdates) { - hasUpdates = true; - if (engine._iconUpdateURL) { - hasIconUpdates = true; - break; - } - } - } - Services.telemetry.getHistogramById("SEARCH_SERVICE_HAS_UPDATES").add(hasUpdates); - Services.telemetry.getHistogramById("SEARCH_SERVICE_HAS_ICON_UPDATES").add(hasIconUpdates); - }, - /** * This map is built lazily after the available search engines change. It * allows quick parsing of an URL representing a search submission into the diff --git a/components/sessionstore/SessionFile.jsm b/components/sessionstore/SessionFile.jsm index 3c55101..3fa6e2a 100644 --- a/components/sessionstore/SessionFile.jsm +++ b/components/sessionstore/SessionFile.jsm @@ -45,8 +45,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "RunState", "resource:///modules/sessionstore/RunState.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); -XPCOMUtils.defineLazyServiceGetter(this, "Telemetry", - "@mozilla.org/base/telemetry;1", "nsITelemetry"); XPCOMUtils.defineLazyServiceGetter(this, "sessionStartup", "@mozilla.org/browser/sessionstartup;1", "nsISessionStartup"); XPCOMUtils.defineLazyModuleGetter(this, "SessionWorker", @@ -234,10 +232,6 @@ var SessionFileInternal = { source: source, parsed: parsed }; - Telemetry.getHistogramById("FX_SESSION_RESTORE_CORRUPT_FILE"). - add(false); - Telemetry.getHistogramById("FX_SESSION_RESTORE_READ_FILE_MS"). - add(Date.now() - startMs); break; } catch (ex if ex instanceof OS.File.Error && ex.becauseNoSuchFile) { exists = false; @@ -253,16 +247,12 @@ var SessionFileInternal = { } finally { if (exists) { noFilesFound = false; - Telemetry.getHistogramById("FX_SESSION_RESTORE_CORRUPT_FILE"). - add(corrupted); } } } // All files are corrupted if files found but none could deliver a result. let allCorrupt = !noFilesFound && !result; - Telemetry.getHistogramById("FX_SESSION_RESTORE_ALL_FILES_CORRUPT"). - add(allCorrupt); if (!result) { // If everything fails, start with an empty session. @@ -331,7 +321,6 @@ var SessionFileInternal = { // Wait until the write is done. promise = promise.then(msg => { // Record how long the write took. - this._recordTelemetry(msg.telemetry); this._successes++; if (msg.result.upgradeBackup) { // We have just completed a backup-on-upgrade, store the information @@ -378,20 +367,4 @@ var SessionFileInternal = { wipe: function () { return this._postToWorker("wipe"); }, - - _recordTelemetry: function(telemetry) { - for (let id of Object.keys(telemetry)){ - let value = telemetry[id]; - let samples = []; - if (Array.isArray(value)) { - samples.push(...value); - } else { - samples.push(value); - } - let histogram = Telemetry.getHistogramById(id); - for (let sample of samples) { - histogram.add(sample); - } - } - } }; diff --git a/components/sessionstore/SessionStore.jsm b/components/sessionstore/SessionStore.jsm index 086bb91..1e886b7 100644 --- a/components/sessionstore/SessionStore.jsm +++ b/components/sessionstore/SessionStore.jsm @@ -135,7 +135,6 @@ Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", this); Cu.import("resource://gre/modules/Promise.jsm", this); Cu.import("resource://gre/modules/Services.jsm", this); Cu.import("resource://gre/modules/Task.jsm", this); -Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", this); Cu.import("resource://gre/modules/Timer.jsm", this); Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); Cu.import("resource://gre/modules/debug.js", this); @@ -145,8 +144,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "gSessionStartup", "@mozilla.org/browser/sessionstartup;1", "nsISessionStartup"); XPCOMUtils.defineLazyServiceGetter(this, "gScreenManager", "@mozilla.org/gfx/screenmanager;1", "nsIScreenManager"); -XPCOMUtils.defineLazyServiceGetter(this, "Telemetry", - "@mozilla.org/base/telemetry;1", "nsITelemetry"); XPCOMUtils.defineLazyModuleGetter(this, "console", "resource://gre/modules/Console.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow", @@ -550,7 +547,6 @@ var SessionStoreInternal = { throw new Error("SessionStore.init() must only be called once!"); } - TelemetryTimestamps.add("sessionRestoreInitialized"); OBSERVING.forEach(function(aTopic) { Services.obs.addObserver(this, aTopic, true); }, this); @@ -782,9 +778,8 @@ var SessionStoreInternal = { return; } - // Record telemetry measurements done in the child and update the tab's - // cached state. Mark the window as dirty and trigger a delayed write. - this.recordTelemetry(aMessage.data.telemetry); + // Update the tab's cached state. + // Mark the window as dirty and trigger a delayed write. TabState.update(browser, aMessage.data); this.saveStateDelayed(win); @@ -919,18 +914,6 @@ var SessionStoreInternal = { } }, - /** - * Record telemetry measurements stored in an object. - * @param telemetry - * {histogramID: value, ...} An object mapping histogramIDs to the - * value to be recorded for that ID, - */ - recordTelemetry: function (telemetry) { - for (let histogramId in telemetry){ - Telemetry.getHistogramById(histogramId).add(telemetry[histogramId]); - } - }, - /* ........ Window Event Handlers .............. */ /** @@ -1081,7 +1064,6 @@ var SessionStoreInternal = { // Nothing to restore now, notify observers things are complete. Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED, ""); } else { - TelemetryTimestamps.add("sessionRestoreRestoring"); this._restoreCount = aInitialState.windows ? aInitialState.windows.length : 0; // global data must be restored before restoreWindow is called so that @@ -3810,8 +3792,7 @@ var SessionStoreInternal = { }, /** - * Update the session start time and send a telemetry measurement - * for the number of days elapsed since the session was started. + * Update the session start time. * * @param state * The session state. @@ -4437,13 +4418,7 @@ var SessionStoreInternal = { * Handle an error report from a content process. */ reportInternalError(data) { - // For the moment, we only report errors through Telemetry. - if (data.telemetry) { - for (let key of Object.keys(data.telemetry)) { - let histogram = Telemetry.getHistogramById(key); - histogram.add(data.telemetry[key]); - } - } + // STUB, was only reported through Telemetry. }, /** diff --git a/components/sessionstore/SessionWorker.js b/components/sessionstore/SessionWorker.js index 7d802a7..1297a11 100644 --- a/components/sessionstore/SessionWorker.js +++ b/components/sessionstore/SessionWorker.js @@ -126,7 +126,6 @@ var Agent = { */ write: function (state, options = {}) { let exn; - let telemetry = {}; // Cap the number of backward and forward shistory entries on shutdown. if (options.isFinalWrite) { @@ -197,9 +196,6 @@ var Agent = { }); } - telemetry.FX_SESSION_RESTORE_WRITE_FILE_MS = Date.now() - startWriteMs; - telemetry.FX_SESSION_RESTORE_FILE_SIZE_BYTES = data.byteLength; - } catch (ex) { // Don't throw immediately exn = exn || ex; @@ -276,7 +272,6 @@ var Agent = { result: { upgradeBackup: upgradeBackupComplete }, - telemetry: telemetry, }; }, diff --git a/components/sessionstore/StartupPerformance.jsm b/components/sessionstore/StartupPerformance.jsm index d1b77a2..361602b 100644 --- a/components/sessionstore/StartupPerformance.jsm +++ b/components/sessionstore/StartupPerformance.jsm @@ -111,18 +111,6 @@ this.StartupPerformance = { return; } - // Once we are done restoring tabs, update Telemetry. - let histogramName = isAutoRestore ? - "FX_SESSION_RESTORE_AUTO_RESTORE_DURATION_UNTIL_EAGER_TABS_RESTORED_MS" : - "FX_SESSION_RESTORE_MANUAL_RESTORE_DURATION_UNTIL_EAGER_TABS_RESTORED_MS"; - let histogram = Services.telemetry.getHistogramById(histogramName); - let delta = this._latestRestoredTimeStamp - this._startTimeStamp; - histogram.add(delta); - - Services.telemetry.getHistogramById("FX_SESSION_RESTORE_NUMBER_OF_EAGER_TABS_RESTORED").add(this._totalNumberOfEagerTabs); - Services.telemetry.getHistogramById("FX_SESSION_RESTORE_NUMBER_OF_TABS_RESTORED").add(this._totalNumberOfTabs); - Services.telemetry.getHistogramById("FX_SESSION_RESTORE_NUMBER_OF_WINDOWS_RESTORED").add(this._totalNumberOfWindows); - // Reset this._startTimeStamp = null; } catch (ex) { diff --git a/components/sessionstore/content/content-sessionStore.js b/components/sessionstore/content/content-sessionStore.js index 858e357..8af3350 100644 --- a/components/sessionstore/content/content-sessionStore.js +++ b/components/sessionstore/content/content-sessionStore.js @@ -628,7 +628,6 @@ var SessionStorageListener = { let size = this.estimateStorageSize(collected); - MessageQueue.push("telemetry", () => ({ FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS: size })); if (size > Preferences.get("browser.sessionstore.dom_storage_limit", DOM_STORAGE_MAX_CHARS)) { // Rather than keeping the old storage, which wouldn't match the rest // of the state of the page, empty the storage. DOM storage will be @@ -800,37 +799,23 @@ var MessageQueue = { let durationMs = Date.now(); let data = {}; - let telemetry = {}; for (let [key, func] of this._data) { let value = func(); - if (key == "telemetry") { - for (let histogramId of Object.keys(value)) { - telemetry[histogramId] = value[histogramId]; - } - } else if (value || (key != "storagechange" && key != "historychange")) { + if (value || (key != "storagechange" && key != "historychange")) { data[key] = value; } } this._data.clear(); - durationMs = Date.now() - durationMs; - telemetry.FX_SESSION_RESTORE_CONTENT_COLLECT_DATA_LONGEST_OP_MS = durationMs; - try { // Send all data to the parent process. sendAsyncMessage("SessionStore:update", { - data, telemetry, flushID, + data, flushID, isFinal: options.isFinal || false, epoch: gCurrentEpoch }); } catch (ex if ex && ex.result == Cr.NS_ERROR_OUT_OF_MEMORY) { - let telemetry = { - FX_SESSION_RESTORE_SEND_UPDATE_CAUSED_OOM: 1 - }; - sendAsyncMessage("SessionStore:error", { - telemetry - }); } }, }; diff --git a/components/sessionstore/nsSessionStartup.js b/components/sessionstore/nsSessionStartup.js index 9cda155..c7bb338 100644 --- a/components/sessionstore/nsSessionStartup.js +++ b/components/sessionstore/nsSessionStartup.js @@ -203,11 +203,6 @@ SessionStartup.prototype = { } } - // Report shutdown success via telemetry. Shortcoming here are - // being-killed-by-OS-shutdown-logic, shutdown freezing after - // session restore was written, etc. - Services.telemetry.getHistogramById("SHUTDOWN_OK").add(!this._previousSessionCrashed); - // set the startup type if (this._previousSessionCrashed && resumeFromCrash) this._sessionType = Ci.nsISessionStartup.RECOVER_SESSION; diff --git a/installer/allowed-dupes.mn b/installer/allowed-dupes.mn index 6a506f1..d9295c9 100644 --- a/installer/allowed-dupes.mn +++ b/installer/allowed-dupes.mn @@ -116,8 +116,6 @@ chrome/en-US/locale/en-US/browser/overrides/dom/dom.properties chrome/en-US/locale/en-US/browser/overrides/global.dtd chrome/en-US/locale/en-US/browser/overrides/global/aboutSupport.dtd chrome/en-US/locale/en-US/browser/overrides/global/aboutSupport.properties -chrome/en-US/locale/en-US/browser/overrides/global/aboutTelemetry.dtd -chrome/en-US/locale/en-US/browser/overrides/global/aboutTelemetry.properties chrome/en-US/locale/en-US/browser/overrides/global/aboutWebrtc.properties chrome/en-US/locale/en-US/browser/overrides/global/mozilla.dtd chrome/en-US/locale/en-US/browser/overrides/intl.css @@ -140,8 +138,6 @@ chrome/en-US/locale/en-US/global/aboutReader.properties chrome/en-US/locale/en-US/global/aboutRights.dtd chrome/en-US/locale/en-US/global/aboutSupport.dtd chrome/en-US/locale/en-US/global/aboutSupport.properties -chrome/en-US/locale/en-US/global/aboutTelemetry.dtd -chrome/en-US/locale/en-US/global/aboutTelemetry.properties chrome/en-US/locale/en-US/global/aboutWebrtc.properties chrome/en-US/locale/en-US/global/charsetMenu.properties chrome/en-US/locale/en-US/global/commonDialogs.properties diff --git a/installer/package-manifest.in b/installer/package-manifest.in index d19fd40..7b27406 100644 --- a/installer/package-manifest.in +++ b/installer/package-manifest.in @@ -314,7 +314,6 @@ @RESPATH@/components/xul.xpt @RESPATH@/components/xultmpl.xpt @RESPATH@/components/zipwriter.xpt -@RESPATH@/components/telemetry.xpt ; JavaScript components @RESPATH@/components/ConsoleAPI.manifest @@ -461,8 +460,6 @@ @RESPATH@/components/captivedetect.js @RESPATH@/components/servicesComponents.manifest @RESPATH@/components/cryptoComponents.manifest -@RESPATH@/components/TelemetryStartup.js -@RESPATH@/components/TelemetryStartup.manifest @RESPATH@/components/XULStore.js @RESPATH@/components/XULStore.manifest @RESPATH@/components/messageWakeupService.js @@ -676,7 +673,6 @@ bin/libfreebl_32int64_3.so @RESPATH@/components/dom_audiochannel.xpt ; Shutdown Terminator -@RESPATH@/components/nsTerminatorTelemetry.js @RESPATH@/components/terminator.manifest #if defined(CLANG_CXX) diff --git a/locales/en-US/chrome/browser/aboutDialog.dtd b/locales/en-US/chrome/browser/aboutDialog.dtd index 0068ba8..b8270ab 100644 --- a/locales/en-US/chrome/browser/aboutDialog.dtd +++ b/locales/en-US/chrome/browser/aboutDialog.dtd @@ -16,8 +16,6 @@ - - diff --git a/locales/en-US/chrome/browser/browser.properties b/locales/en-US/chrome/browser/browser.properties index e51fec0..7605fdf 100644 --- a/locales/en-US/chrome/browser/browser.properties +++ b/locales/en-US/chrome/browser/browser.properties @@ -427,11 +427,6 @@ safeModeRestartButton=Restart # menu, set this to "true". Otherwise, you can leave it as "false". browser.menu.showCharacterEncoding=false -# Mozilla data reporting notification (Telemetry, Iceweasel-UXP Health Report, etc) -dataReportingNotification.message = %1$S automatically sends some data to %2$S so that we can improve your experience. -dataReportingNotification.button.label = Choose What I Share -dataReportingNotification.button.accessKey = C - # Process hang reporter processHang.label = A web page is slowing down your browser. What would you like to do? processHang.button_stop.label = Stop It diff --git a/modules/ContentCrashHandlers.jsm b/modules/ContentCrashHandlers.jsm index 488cc4f..459ff41 100644 --- a/modules/ContentCrashHandlers.jsm +++ b/modules/ContentCrashHandlers.jsm @@ -86,12 +86,6 @@ this.TabCrashHandler = { let childID = aSubject.get("childID"); let dumpID = aSubject.get("dumpID"); - if (!dumpID) { - Services.telemetry - .getHistogramById("FX_CONTENT_CRASH_DUMP_UNAVAILABLE") - .add(1); - } - if (!this.flushCrashedBrowserQueue(childID)) { this.unseenCrashedChildIDs.push(childID); // The elements in unseenCrashedChildIDs will only be removed if @@ -375,12 +369,6 @@ this.TabCrashHandler = { data.email = this.prefs.getCharPref("email", ""); } - // Make sure to only count once even if there are multiple windows - // that will all show about:tabcrashed. - if (this._crashedTabCount == 1) { - Services.telemetry.getHistogramById("FX_CONTENT_CRASH_PRESENTED").add(1); - } - message.target.sendAsyncMessage("SetCrashReportAvailable", data); }, @@ -401,12 +389,6 @@ this.TabCrashHandler = { let browser = message.target.browser; let childID = this.browserMap.get(browser.permanentKey); - - // Make sure to only count once even if there are multiple windows - // that will all show about:tabcrashed. - if (this._crashedTabCount == 0 && childID) { - Services.telemetry.getHistogramById("FX_CONTENT_CRASH_NOT_SUBMITTED").add(1); - } }, /** diff --git a/modules/ContentLinkHandler.jsm b/modules/ContentLinkHandler.jsm index 443cae2..76822e8 100644 --- a/modules/ContentLinkHandler.jsm +++ b/modules/ContentLinkHandler.jsm @@ -19,13 +19,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Feeds", XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils", "resource://gre/modules/BrowserUtils.jsm"); -const SIZES_TELEMETRY_ENUM = { - NO_SIZES: 0, - ANY: 1, - DIMENSION: 2, - INVALID: 3, -}; - this.ContentLinkHandler = { init: function(chromeGlobal) { chromeGlobal.addEventListener("DOMLinkAdded", (event) => { @@ -79,35 +72,6 @@ this.ContentLinkHandler = { if (!uri) break; - // Telemetry probes for measuring the sizes attribute - // usage and available dimensions. - let sizeHistogramTypes = Services.telemetry. - getHistogramById("LINK_ICON_SIZES_ATTR_USAGE"); - let sizeHistogramDimension = Services.telemetry. - getHistogramById("LINK_ICON_SIZES_ATTR_DIMENSION"); - let sizesType; - if (link.sizes.length) { - for (let size of link.sizes) { - if (size.toLowerCase() == "any") { - sizesType = SIZES_TELEMETRY_ENUM.ANY; - break; - } else { - let re = /^([1-9][0-9]*)x[1-9][0-9]*$/i; - let values = re.exec(size); - if (values && values.length > 1) { - sizesType = SIZES_TELEMETRY_ENUM.DIMENSION; - sizeHistogramDimension.add(parseInt(values[1])); - } else { - sizesType = SIZES_TELEMETRY_ENUM.INVALID; - break; - } - } - } - } else { - sizesType = SIZES_TELEMETRY_ENUM.NO_SIZES; - } - sizeHistogramTypes.add(sizesType); - chromeGlobal.sendAsyncMessage( "Link:SetIcon", {url: uri.spec, loadingPrincipal: link.ownerDocument.nodePrincipal}); diff --git a/modules/PermissionUI.jsm b/modules/PermissionUI.jsm index ffae095..aea512b 100644 --- a/modules/PermissionUI.jsm +++ b/modules/PermissionUI.jsm @@ -234,9 +234,7 @@ this.PermissionPromptPrototype = { /** * If the prompt will be shown to the user, this callback will - * be called just before. Subclasses may want to override this - * in order to, for example, bump a counter Telemetry probe for - * how often a particular permission request is seen. + * be called just before. Subclasses may want to override this. */ onBeforeShow() {}, diff --git a/modules/PluginContent.jsm b/modules/PluginContent.jsm index 622d608..f9f4b0e 100644 --- a/modules/PluginContent.jsm +++ b/modules/PluginContent.jsm @@ -167,7 +167,6 @@ PluginContent.prototype = { return; } - this._finishRecordingFlashPluginTelemetry(); this.clearPluginCaches(); this.haveShownNotification = false; }, @@ -533,19 +532,11 @@ PluginContent.prototype = { case "PluginInstantiated": let key = this._getPluginInfo(plugin).pluginTag.niceName; - Services.telemetry.getKeyedHistogramById('PLUGIN_ACTIVATION_COUNT').add(key); shouldShowNotification = true; let pluginRect = plugin.getBoundingClientRect(); - if (pluginRect.width <= 5 && pluginRect.height <= 5) { - Services.telemetry.getHistogramById('PLUGIN_TINY_CONTENT').add(1); - } break; } - if (this._getPluginInfo(plugin).mimetype === FLASH_MIME_TYPE) { - this._recordFlashPluginTelemetry(eventType, plugin); - } - // Show the in-content UI if it's not too big. The crashed plugin handler already did this. let overlay = this.getPluginUI(plugin, "main"); if (eventType != "PluginCrashed") { @@ -577,49 +568,6 @@ PluginContent.prototype = { } }, - _recordFlashPluginTelemetry: function (eventType, plugin) { - if (!Services.telemetry.canRecordExtended) { - return; - } - - if (!this.flashPluginStats) { - this.flashPluginStats = { - instancesCount: 0, - plugins: new WeakSet() - }; - } - - if (!this.flashPluginStats.plugins.has(plugin)) { - // Reporting plugin instance and its dimensions only once. - this.flashPluginStats.plugins.add(plugin); - - this.flashPluginStats.instancesCount++; - - let pluginRect = plugin.getBoundingClientRect(); - Services.telemetry.getHistogramById('FLASH_PLUGIN_WIDTH') - .add(pluginRect.width); - Services.telemetry.getHistogramById('FLASH_PLUGIN_HEIGHT') - .add(pluginRect.height); - Services.telemetry.getHistogramById('FLASH_PLUGIN_AREA') - .add(pluginRect.width * pluginRect.height); - - let state = this._getPluginInfo(plugin).fallbackType; - if (state === null) { - state = Ci.nsIObjectLoadingContent.PLUGIN_UNSUPPORTED; - } - Services.telemetry.getHistogramById('FLASH_PLUGIN_STATES') - .add(state); - } - }, - - _finishRecordingFlashPluginTelemetry: function () { - if (this.flashPluginStats) { - Services.telemetry.getHistogramById('FLASH_PLUGIN_INSTANCES_ON_PAGE') - .add(this.flashPluginStats.instancesCount); - delete this.flashPluginStats; - } - }, - isKnownPlugin: function (objLoadingContent) { return (objLoadingContent.getContentTypeForMIMEType(objLoadingContent.actualType) == Ci.nsIObjectLoadingContent.TYPE_PLUGIN); diff --git a/modules/ProcessHangMonitor.jsm b/modules/ProcessHangMonitor.jsm index 474c7c0..526fcd2 100644 --- a/modules/ProcessHangMonitor.jsm +++ b/modules/ProcessHangMonitor.jsm @@ -364,17 +364,6 @@ var ProcessHangMonitor = { return; } - // On e10s this counts slow-script/hanged-plugin notice only once. - // This code is not reached on non-e10s. - if (report.hangType == report.SLOW_SCRIPT) { - // On non-e10s, SLOW_SCRIPT_NOTICE_COUNT is probed at nsGlobalWindow.cpp - Services.telemetry.getHistogramById("SLOW_SCRIPT_NOTICE_COUNT").add(); - } else if (report.hangType == report.PLUGIN_HANG) { - // On non-e10s we have sufficient plugin telemetry probes, - // so PLUGIN_HANG_NOTICE_COUNT is only probed on e10s. - Services.telemetry.getHistogramById("PLUGIN_HANG_NOTICE_COUNT").add(); - } - this._activeReports.add(report); this.updateWindows(); }, diff --git a/themes/preprocess-tab-svgs.pyc b/themes/preprocess-tab-svgs.pyc index d78dc7f..2f86716 100644 Binary files a/themes/preprocess-tab-svgs.pyc and b/themes/preprocess-tab-svgs.pyc differ -- cgit v1.2.3