Bug 1496638 - Instrument fetchMissedRemoteCommands with telemetry r=markh
authorEdouard Oger <eoger@fastmail.com>
Mon, 15 Oct 2018 05:42:02 +0000
changeset 499752 1ae5b0d96fab39812dc8cd5d8b211c0befbd839f
parent 499751 8866a66f76593da837ea35dc27ebf5e289735c7f
child 499753 bd8f6c06661e05ff6d0f3b56e05c3c39e76958a9
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1496638
milestone64.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 1496638 - Instrument fetchMissedRemoteCommands with telemetry r=markh Differential Revision: https://phabricator.services.mozilla.com/D7912
services/fxaccounts/FxAccountsCommands.js
toolkit/components/telemetry/Scalars.yaml
--- a/services/fxaccounts/FxAccountsCommands.js
+++ b/services/fxaccounts/FxAccountsCommands.js
@@ -82,16 +82,17 @@ class FxAccountsCommands {
       handledCommands.push(lastCommandIndex); // Because the server also returns this command.
       const {index, messages} = await this._fetchRemoteCommands(lastCommandIndex);
       const missedMessages = messages.filter(m => !handledCommands.includes(m.index));
       await updateUserData({
         device: {...device, lastCommandIndex: index, handledCommands: []},
       });
       if (missedMessages.length) {
         log.info(`Handling ${missedMessages.length} missed messages`);
+        Services.telemetry.scalarAdd("identity.fxaccounts.missed_commands_fetched", missedMessages.length);
         await this._handleCommands(missedMessages);
       }
     });
     return true;
   }
 
   async _fetchRemoteCommands(index, limit = null) {
     const userData = await this._fxAccounts.getSignedInUser();
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -439,16 +439,31 @@ services.sync:
     kind: boolean
     keyed: true
     notification_emails:
       - sync-staff@mozilla.com
     release_channel_collection: opt-out
     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
+    keyed: false
+    notification_emails:
+      - fxa-staff@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - main
+
 security:
   pkcs11_modules_loaded:
     bug_numbers:
       - 1369911
       - 1445961
     description: >
       A keyed boolean indicating the library names of the PKCS#11 modules that
       have been loaded by the browser.