Bug 1621742 - Removed storage.sync telemetry scalars expired in Firefox 64. r=mixedpuppy,janerik
authorLuca Greco <lgreco@mozilla.com>
Tue, 24 Mar 2020 16:44:59 +0000
changeset 520559 50ecaae73f4514df4d62c176c567ac1e8e603d37
parent 520558 526758bcd4c2b99f44524c470a248563fd34aa6b
child 520560 9e2c0c0d9352f73ecf69f5d6c32dada742d7c068
push id37253
push usernerli@mozilla.com
push dateThu, 26 Mar 2020 21:36:52 +0000
treeherdermozilla-central@c644dd16e2cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy, janerik
bugs1621742
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1621742 - Removed storage.sync telemetry scalars expired in Firefox 64. r=mixedpuppy,janerik Differential Revision: https://phabricator.services.mozilla.com/D67198
toolkit/components/extensions/ExtensionStorageSync.jsm
toolkit/components/telemetry/Scalars.yaml
--- a/toolkit/components/extensions/ExtensionStorageSync.jsm
+++ b/toolkit/components/extensions/ExtensionStorageSync.jsm
@@ -27,24 +27,20 @@ const STORAGE_SYNC_ENABLED_PREF = "webex
 const STORAGE_SYNC_SERVER_URL_PREF = "webextensions.storage.sync.serverURL";
 const STORAGE_SYNC_SCOPE = "sync:addon_storage";
 const STORAGE_SYNC_CRYPTO_COLLECTION_NAME = "storage-sync-crypto";
 const STORAGE_SYNC_CRYPTO_KEYRING_RECORD_ID = "keys";
 const STORAGE_SYNC_CRYPTO_SALT_LENGTH_BYTES = 32;
 const FXA_OAUTH_OPTIONS = {
   scope: STORAGE_SYNC_SCOPE,
 };
-const SCALAR_EXTENSIONS_USING = "storage.sync.api.usage.extensions_using";
-const SCALAR_ITEMS_STORED = "storage.sync.api.usage.items_stored";
-const SCALAR_STORAGE_CONSUMED = "storage.sync.api.usage.storage_consumed";
 // Default is 5sec, which seems a bit aggressive on the open internet
 const KINTO_REQUEST_TIMEOUT = 30000;
 
 const { Log } = ChromeUtils.import("resource://gre/modules/Log.jsm");
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
 );
 const { ExtensionUtils } = ChromeUtils.import(
   "resource://gre/modules/ExtensionUtils.jsm"
 );
 
 XPCOMUtils.defineLazyModuleGetters(this, {
@@ -747,22 +743,19 @@ const openCollection = async function(cr
   });
   return coll;
 };
 
 class ExtensionStorageSync {
   /**
    * @param {FXAccounts} fxaService (Optional) If not
    *    present, trying to sync will fail.
-   * @param {nsITelemetry} telemetry Telemetry service to use to
-   *    report sync usage.
    */
-  constructor(fxaService, telemetry) {
+  constructor(fxaService) {
     this._fxaService = fxaService;
-    this._telemetry = telemetry;
     this.cryptoCollection = new CryptoCollection(fxaService);
     this.listeners = new WeakMap();
   }
 
   /**
    * Get a set of extensions to sync (including the ones with an
    * active extension context that used the storage.sync API and
    * the extensions that are enabled and have been synced before).
@@ -806,33 +799,16 @@ class ExtensionStorageSync {
     await this.ensureCanSync(extIds);
     await this.checkSyncKeyRing();
     const promises = Array.from(extensions, extension => {
       return openCollection(this.cryptoCollection, extension).then(coll => {
         return this.sync(extension, coll);
       });
     });
     await Promise.all(promises);
-
-    // This needs access to an adapter, but any adapter will do
-    const collection = await this.cryptoCollection.getCollection();
-    const storage = await collection.db.calculateStorage();
-    this._telemetry.scalarSet(SCALAR_EXTENSIONS_USING, storage.length);
-    for (let { collectionName, size, numRecords } of storage) {
-      this._telemetry.keyedScalarSet(
-        SCALAR_ITEMS_STORED,
-        collectionName,
-        numRecords
-      );
-      this._telemetry.keyedScalarSet(
-        SCALAR_STORAGE_CONSUMED,
-        collectionName,
-        size
-      );
-    }
   }
 
   async sync(extension, collection) {
     throwIfNoFxA(this._fxaService, "syncing chrome.storage.sync");
     const isSignedIn = !!(await this._fxaService.getSignedInUser());
     if (!isSignedIn) {
       // FIXME: this should support syncing to self-hosted
       log.info("User was not signed into FxA; cannot sync");
@@ -1382,12 +1358,9 @@ class ExtensionStorageSync {
     if (listeners) {
       for (let listener of listeners) {
         ExtensionCommon.runSafeSyncWithoutClone(listener, changes);
       }
     }
   }
 }
 this.ExtensionStorageSync = ExtensionStorageSync;
-extensionStorageSync = new ExtensionStorageSync(
-  _fxaService,
-  Services.telemetry
-);
+extensionStorageSync = new ExtensionStorageSync(_fxaService);
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -624,79 +624,16 @@ extensions.updates:
       - addons-dev-internal@mozilla.com
     products:
       - 'firefox'
       - 'fennec'
       - 'geckoview'
     record_in_processes:
       - main
 
-# This section is for probes used to measure use of the Webextensions storage.sync API.
-storage.sync.api.usage:
-  extensions_using:
-    bug_numbers:
-      - 1328974
-    description: >
-      The count of webextensions that have data stored in the chrome.storage.sync API.
-      This includes extensions that have not used the storage.sync API this session.
-      This includes items that were not stored this session.
-      This scalar is collected after every sync.
-    expires: "64"
-    kind: uint
-    keyed: false
-    notification_emails:
-      - eglassercamp@mozilla.com
-    release_channel_collection: opt-out
-    products:
-      - 'firefox'
-      - 'fennec'
-      - 'geckoview'
-    record_in_processes:
-      - main
-  items_stored:
-    bug_numbers:
-      - 1328974
-    description: >
-      The count of items in storage.sync storage, broken down by extension ID.
-      This includes extensions that have not used the storage.sync API this session.
-      This includes items that were not stored this session.
-      This scalar is collected after every sync.
-    expires: "64"
-    kind: uint
-    keyed: true
-    notification_emails:
-      - eglassercamp@mozilla.com
-    release_channel_collection: opt-out
-    products:
-      - 'firefox'
-      - 'fennec'
-      - 'geckoview'
-    record_in_processes:
-      - main
-  storage_consumed:
-    bug_numbers:
-      - 1328974
-    description: >
-      The count of bytes used in storage.sync, broken down by extension ID.
-      This includes extensions that have not used the storage.sync API this session.
-      This includes items that were not stored this session.
-      This scalar is collected after every sync.
-    expires: "64"
-    kind: uint
-    keyed: true
-    notification_emails:
-      - eglassercamp@mozilla.com
-    release_channel_collection: opt-out
-    products:
-      - 'firefox'
-      - 'fennec'
-      - 'geckoview'
-    record_in_processes:
-      - main
-
 identity.fxaccounts:
   missed_commands_fetched:
     bug_numbers:
       - 1496638
     description: >
       The number of missed FxA commands we have recovered.
     expires: "68"
     kind: uint