Bug 1621742 - Removed STORAGE_SYNC_* histograms. r=mixedpuppy,janerik
authorLuca Greco <lgreco@mozilla.com>
Tue, 24 Mar 2020 16:44:36 +0000
changeset 520575 526758bcd4c2b99f44524c470a248563fd34aa6b
parent 520574 8e84a9a4f6df4fc4f84b76ace926c6497f972ff3
child 520576 50ecaae73f4514df4d62c176c567ac1e8e603d37
push id111168
push userluca.greco@alcacoop.it
push dateThu, 26 Mar 2020 13:42:58 +0000
treeherderautoland@50ecaae73f45 [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_* histograms. r=mixedpuppy,janerik Differential Revision: https://phabricator.services.mozilla.com/D67197
toolkit/components/extensions/ExtensionStorageSync.jsm
toolkit/components/telemetry/Histograms.json
--- a/toolkit/components/extensions/ExtensionStorageSync.jsm
+++ b/toolkit/components/extensions/ExtensionStorageSync.jsm
@@ -27,19 +27,16 @@ 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 HISTOGRAM_GET_OPS_SIZE = "STORAGE_SYNC_GET_OPS_SIZE";
-const HISTOGRAM_SET_OPS_SIZE = "STORAGE_SYNC_SET_OPS_SIZE";
-const HISTOGRAM_REMOVE_OPS = "STORAGE_SYNC_REMOVE_OPS";
 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");
@@ -1244,26 +1241,22 @@ class ExtensionStorageSync {
     this.registerInUse(extension, context);
     return openCollection(this.cryptoCollection, extension, context);
   }
 
   async set(extension, items, context) {
     const coll = await this.getCollection(extension, context);
     const keys = Object.keys(items);
     const ids = keys.map(keyToId);
-    const histogramSize = this._telemetry.getKeyedHistogramById(
-      HISTOGRAM_SET_OPS_SIZE
-    );
     const changes = await coll.execute(
       txn => {
         let changes = {};
         for (let [i, key] of keys.entries()) {
           const id = ids[i];
           let item = items[key];
-          histogramSize.add(extension.id, JSON.stringify(item).length);
           let { oldRecord } = txn.upsert({
             id,
             key,
             data: item,
           });
           changes[key] = {
             newValue: item,
           };
@@ -1298,20 +1291,16 @@ class ExtensionStorageSync {
         }
         return changes;
       },
       { preloadIds: ids }
     );
     if (Object.keys(changes).length) {
       this.notifyListeners(extension, changes);
     }
-    const histogram = this._telemetry.getKeyedHistogramById(
-      HISTOGRAM_REMOVE_OPS
-    );
-    histogram.add(extension.id, keys.length);
   }
 
   /* Wipe local data for all collections without causing the changes to be synced */
   async clearAll() {
     const extensions = await this.getExtensions();
     const extIds = Array.from(extensions, extension => extension.id);
     log.debug(`Clearing extension data for ${JSON.stringify(extIds)}`);
     if (extIds.length) {
@@ -1336,25 +1325,21 @@ class ExtensionStorageSync {
     const res = await coll.list();
     const records = res.data;
     const keys = records.map(record => record.key);
     await this.remove(extension, keys, context);
   }
 
   async get(extension, spec, context) {
     const coll = await this.getCollection(extension, context);
-    const histogramSize = this._telemetry.getKeyedHistogramById(
-      HISTOGRAM_GET_OPS_SIZE
-    );
     let keys, records;
     if (spec === null) {
       records = {};
       const res = await coll.list();
       for (let record of res.data) {
-        histogramSize.add(extension.id, JSON.stringify(record.data).length);
         records[record.key] = record.data;
       }
       return records;
     }
     if (typeof spec === "string") {
       keys = [spec];
       records = {};
     } else if (Array.isArray(spec)) {
@@ -1363,17 +1348,16 @@ class ExtensionStorageSync {
     } else {
       keys = Object.keys(spec);
       records = Cu.cloneInto(spec, global);
     }
 
     for (let key of keys) {
       const res = await coll.getAny(keyToId(key));
       if (res.data && res.data._status != "deleted") {
-        histogramSize.add(extension.id, JSON.stringify(res.data.data).length);
         records[res.data.key] = res.data.data;
       }
     }
 
     return records;
   }
 
   addOnChangedListener(extension, listener, context) {
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -13216,53 +13216,16 @@
     "record_in_processes": ["main", "content"],
     "products": ["firefox", "fennec", "geckoview"],
     "alert_emails": ["amarchesini@mozilla.com"],
     "expires_in_version": "59",
     "bug_numbers": [1276006],
     "kind": "count",
     "description": "Tracking the total number of opened Containers."
   },
-  "STORAGE_SYNC_GET_OPS_SIZE": {
-    "record_in_processes": ["main", "content"],
-    "products": ["firefox", "fennec", "geckoview"],
-    "alert_emails": ["addons-dev-internal@mozilla.com", "eglassercamp@mozilla.com", "lgreco@mozilla.com"],
-    "expires_in_version": "77",
-    "bug_numbers": [1328974, 1513556, 1578225],
-    "kind": "exponential",
-    "high": 100000,
-    "n_buckets": 30,
-    "keyed": true,
-    "description": "Track the size of results of get() operations performed this subsession. The key is the addon ID.",
-    "releaseChannelCollection": "opt-out"
-  },
-  "STORAGE_SYNC_SET_OPS_SIZE": {
-    "record_in_processes": ["main", "content"],
-    "products": ["firefox", "fennec", "geckoview"],
-    "alert_emails": ["addons-dev-internal@mozilla.com", "eglassercamp@mozilla.com", "lgreco@mozilla.com"],
-    "expires_in_version": "77",
-    "bug_numbers": [1328974, 1513556, 1578225],
-    "kind": "exponential",
-    "high": 100000,
-    "n_buckets": 30,
-    "keyed": true,
-    "description": "Track the size of set() operations performed by addons this subsession. The key is the addon ID.",
-    "releaseChannelCollection": "opt-out"
-  },
-  "STORAGE_SYNC_REMOVE_OPS": {
-    "record_in_processes": ["main", "content"],
-    "products": ["firefox", "fennec", "geckoview"],
-    "alert_emails": ["addons-dev-internal@mozilla.com", "eglassercamp@mozilla.com", "lgreco@mozilla.com"],
-    "expires_in_version": "77",
-    "bug_numbers": [1328974, 1513556, 1578225],
-    "kind": "count",
-    "keyed": true,
-    "description": "Track the number of remove() operations addons perform this subsession. The key is the addon ID.",
-    "releaseChannelCollection": "opt-out"
-  },
   "NUMBER_OF_PROFILES": {
     "record_in_processes": ["main", "content"],
     "products": ["firefox", "fennec", "geckoview"],
     "alert_emails": ["dtownsend@mozilla.com"],
     "expires_in_version": "70",
     "bug_numbers": [1296606, 1488881, 1490342],
     "kind": "count",
     "description": "Number of named browser profiles for the current user, as reported by the profile service at startup.",