Bug 1462725 - Dupe 'search' event probe under 'savant' category; r=rhelmer draft
authorBianca Danforth <bdanforth@mozilla.com>
Mon, 04 Jun 2018 16:19:51 -0700
changeset 803870 edcc1ece90b8cc6a072703914bcfc1e6c87b7670
parent 803869 a2f757a67a4b638bcfec112dff26ca07e63b1517
child 803871 175a029e1d0c3c536cc601e6382568832258aad5
push id112222
push userbdanforth@mozilla.com
push dateMon, 04 Jun 2018 23:26:13 +0000
reviewersrhelmer
bugs1462725
milestone62.0a1
Bug 1462725 - Dupe 'search' event probe under 'savant' category; r=rhelmer The duplication is so that this study’s use of the probe does not affect and is not affected by other uses of the probe. MozReview-Commit-ID: 5JUbiQdZc3R
browser/modules/BrowserUsageTelemetry.jsm
browser/modules/ShieldStudySavant.jsm
toolkit/components/telemetry/Events.yaml
--- a/browser/modules/BrowserUsageTelemetry.jsm
+++ b/browser/modules/BrowserUsageTelemetry.jsm
@@ -434,16 +434,19 @@ let BrowserUsageTelemetry = {
   },
 
   _recordSearch(engine, source, action = null) {
     let scalarKey = action ? "search_" + action : "search";
     Services.telemetry.keyedScalarAdd("browser.engagement.navigation." + source,
                                       scalarKey, 1);
     Services.telemetry.recordEvent("navigation", "search", source, action,
                                    { engine: getSearchEngineId(engine) });
+    Services.telemetry.recordEvent("savant", "search", source, action,
+                                   { subcategory: "navigation",
+                                   engine: getSearchEngineId(engine) });
   },
 
   _handleSearchAction(engine, source, details) {
     switch (source) {
       case "urlbar":
       case "oneoff-urlbar":
       case "searchbar":
       case "oneoff-searchbar":
--- a/browser/modules/ShieldStudySavant.jsm
+++ b/browser/modules/ShieldStudySavant.jsm
@@ -91,16 +91,16 @@ class TelemetryEvents {
   }
 
   sendEvent(method, object, value, extra) {
     Services.telemetry.recordEvent(this.STUDY_TELEMETRY_CATEGORY, method, object, value, extra);
   }
 
   enableCollection() {
     log.debug("Study has been enabled; turning ON data collection.");
-    // Services.telemetry.setEventRecordingEnabled(this.STUDY_TELEMETRY_CATEGORY, true);
+    Services.telemetry.setEventRecordingEnabled(this.STUDY_TELEMETRY_CATEGORY, true);
   }
 
   disableCollection() {
     log.debug("Study has been disabled; turning OFF data collection.");
-    // Services.telemetry.setEventRecordingEnabled(this.STUDY_TELEMETRY_CATEGORY, false);
+    Services.telemetry.setEventRecordingEnabled(this.STUDY_TELEMETRY_CATEGORY, false);
   }
 }
--- a/toolkit/components/telemetry/Events.yaml
+++ b/toolkit/components/telemetry/Events.yaml
@@ -80,16 +80,38 @@ navigation:
     bug_numbers: [1316281]
     notification_emails:
       - "past@mozilla.com"
       - "dzeber@mozilla.com"
     expiry_version: "65"
     extra_keys:
       engine: The id of the search engine used.
 
+# This category contains event entries used for the Savant Shield study.
+savant:
+  # Mostly a dupe of "search" event from "navigation" category to ensure only Savant
+  # code enables/disables it.
+  search:
+    objects: ["about_home", "about_newtab", "contextmenu", "oneoff",
+              "suggestion", "alias", "enter", "searchbar", "urlbar"]
+    release_channel_collection: opt-out
+    record_in_processes: ["main"]
+    description: >
+      This is recorded on each search navigation.
+      The value field records the action used to trigger the search:
+        "enter", "oneoff", "suggestion", "alias", null (for contextmenu)
+    bug_numbers: [1316281, 1457226]
+    notification_emails:
+      - "bdanforth@mozilla.com"
+      - "shong@mozilla.com"
+    expiry_version: "65"
+    extra_keys:
+      subcategory: The broad event category for this probe. E.g. navigation
+      engine: The id of the search engine used.
+
 # This category contains event entries used for Telemetry tests.
 # They will not be sent out with any pings.
 telemetry.test:
   test:
     methods: ["test1", "test2"]
     objects: ["object1", "object2"]
     bug_numbers: [1286606]
     notification_emails: ["telemetry-client-dev@mozilla.com"]