Bug 1514940 - part 2: Add telemetry probe to decide when we can remove the hack for Confluence data-review=liuche, r=smaug,janerik
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 14 Mar 2019 05:39:38 +0000
changeset 524836 92d9228ac82d8ae5d30af464014d4e037917b578
parent 524835 d322d19da585f18c34472de38e795028959c68d1
child 524837 6d98527df96dc3c8d3bc30c2847b8675c4e46f44
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, janerik
bugs1514940
milestone67.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 1514940 - part 2: Add telemetry probe to decide when we can remove the hack for Confluence data-review=liuche, r=smaug,janerik We need to collect how many Confluence instances are loaded and how percentage of that is old versions which require split keypress event model. Differential Revision: https://phabricator.services.mozilla.com/D17908
toolkit/actors/KeyPressEventModelCheckerChild.jsm
toolkit/components/telemetry/Scalars.yaml
--- a/toolkit/actors/KeyPressEventModelCheckerChild.jsm
+++ b/toolkit/actors/KeyPressEventModelCheckerChild.jsm
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["KeyPressEventModelCheckerChild"];
 
 const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
 const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
+const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 class KeyPressEventModelCheckerChild extends ActorChild {
   // Currently, the event is dispatched only when the document becomes editable
   // because of contenteditable.  If you need to add new editor which is in
   // designMode, you need to change MaybeDispatchCheckKeyPressEventModelEvent()
   // of nsHTMLDocument.
   handleEvent(aEvent) {
     if (!AppConstants.DEBUG) {
@@ -63,14 +64,23 @@ class KeyPressEventModelCheckerChild ext
       }
     }
     // If there is tinyMCE object, we can assume that we loaded Confluence
     // instance.  So, let's check the version whether it allows conflated
     // keypress event model.
     try {
       let {author, version} =
           new tinyMCEObject.plugins.CursorTargetPlugin().getInfo();
-      return author === "Atlassian" && version === "1.0";
+      // If it's not Confluence, don't include it into the telemetry because
+      // we just need to collect percentage of old version in all loaded
+      // Confluence instances.
+      if (author !== "Atlassian") {
+        return false;
+      }
+      let isOldVersion = version === "1.0";
+      Services.telemetry.keyedScalarAdd("dom.event.confluence_load_count",
+                                        isOldVersion ? "old" : "new", 1);
+      return isOldVersion;
     } catch (e) {
       return false;
     }
   }
 }
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -1754,16 +1754,34 @@ devtools.changesview:
     kind: uint
     notification_emails:
       - dev-developer-tools@lists.mozilla.org
       - mbalfanz@mozilla.com
     release_channel_collection: opt-out
     record_in_processes:
       - 'main'
 
+dom.event:
+  confluence_load_count:
+    bug_numbers:
+      - 1514940
+    description: >
+      Number of times Confluence instances are loaded, and whether they are
+      compatible with conflated keypress event model or not, using "new"/"old".
+      I.e., collecting percentage of too old Confluence instance use count in
+      all Confluence instance use count.
+    expires: "71"
+    keyed: true
+    kind: uint
+    notification_emails:
+      - mnakano@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - 'content'
+
 navigator.storage:
   estimate_count:
     bug_numbers:
       - 1359708
     description: >
       Number of times navigator.storage.estimate has been used.
     expires: "60"
     kind: uint