Bug 1462725 - Dupe 'search' event probe under 'savant' category; r=rhelmer, a=RyanVM
authorBianca Danforth <bdanforth@mozilla.com>
Mon, 04 Jun 2018 16:19:51 -0700
changeset 473702 8b46c0eeed0efb79837acfbaed9df3ceaf82686e
parent 473701 055f4112239953fd379d2a73ec1af7ae81abd652
child 473703 e948d63a5eeda191c29a7f2a5201aa8950953c9f
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhelmer, RyanVM
bugs1462725
milestone61.0
Bug 1462725 - Dupe 'search' event probe under 'savant' category; r=rhelmer, a=RyanVM 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"]