bug 1333797 - Require 'record_in_processes' values in Scalars.yaml r=Dexter
authorChris H-C <chutten@mozilla.com>
Wed, 25 Jan 2017 14:10:22 -0500
changeset 331770 43c2c4c0324de97236ccef58707fc75772a56811
parent 331769 8c15a4cab253bc3c82efa8348e77f788fd48e661
child 331813 6694869418befc4b7f17a9478f183f7b4912c44e
push id36691
push userchutten@mozilla.com
push dateTue, 31 Jan 2017 14:58:51 +0000
treeherderautoland@43c2c4c0324d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersDexter
bugs1333797
milestone54.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 1333797 - Require 'record_in_processes' values in Scalars.yaml r=Dexter Having "main" be the default value is a very sensible choice, but one that is a little opaque if you aren't into reading Telemetry code. Just require a value here, and this will encourage correct use as it can be caught and policed in data-review. MozReview-Commit-ID: ASaWGuPAc9a
toolkit/components/telemetry/Scalars.yaml
toolkit/components/telemetry/docs/collection/scalars.rst
toolkit/components/telemetry/parse_scalars.py
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -10,275 +10,321 @@ browser.engagement:
       The count of maximum number of tabs open during a subsession,
       across all windows, including tabs in private windows and restored
       at startup.
     expires: "55"
     kind: uint
     notification_emails:
       - rweiss@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   tab_open_event_count:
     bug_numbers:
       - 1271304
     description: >
       The count of tab open events per subsession, across all windows, after the
       session has been restored. This includes tab open events from private windows
       and from manual session restorations (i.e. after crashes and from about:home).
     expires: "55"
     kind: uint
     notification_emails:
       - rweiss@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   max_concurrent_window_count:
     bug_numbers:
       - 1271304
     description: >
       The count of maximum number of browser windows open during a subsession. This
       includes private windows and the ones opened when starting the browser.
     expires: "55"
     kind: uint
     notification_emails:
       - rweiss@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   window_open_event_count:
     bug_numbers:
       - 1271304
     description: >
       The count of browser window open events per subsession, after the session
       has been restored. The count includes private windows and the ones from manual
       session restorations (i.e. after crashes and from about:home).
     expires: "55"
     kind: uint
     notification_emails:
       - rweiss@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   total_uri_count:
     bug_numbers:
       - 1271313
     description: >
       The count of the total non-unique http(s) URIs visited in a subsession, including
       page reloads, after the session has been restored. This does not include background
       page requests and URIs from embedded pages or private browsing.
     expires: "55"
     kind: uint
     notification_emails:
       - rweiss@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   unfiltered_uri_count:
     bug_numbers:
       - 1304647
     description: >
       The count of the total non-unique URIs visited in a subsession, not restricted to
       a specific protocol, including page reloads and about:* pages (other than initial
       pages such as about:blank, ...), after the session has been restored. This does
       not include background page requests and URIs from embedded pages or private browsing.
     expires: "55"
     kind: uint
     notification_emails:
       - bcolloran@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   unique_domains_count:
     bug_numbers:
       - 1271310
     description: >
       The count of the unique domains visited in a subsession, after the session
       has been restored. Subdomains under eTLD are aggregated after the first level
       (i.e. test.example.com and other.example.com are only counted once).
       This does not include background page requests and domains from embedded pages
       or private browsing. The count is limited to 100 unique domains.
     expires: "55"
     kind: uint
     notification_emails:
       - rweiss@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
 # The following section contains the browser engagement scalars.
 browser.engagement.navigation:
   urlbar:
     bug_numbers:
       - 1271313
     description: >
       The count URI loads triggered in a subsession from the urlbar (awesomebar),
       broken down by the originating action.
     expires: "55"
     kind: uint
     keyed: true
     notification_emails:
       - bcolloran@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   searchbar:
     bug_numbers:
       - 1271313
     description: >
       The count URI loads triggered in a subsession from the searchbar,
       broken down by the originating action.
     expires: "55"
     kind: uint
     keyed: true
     notification_emails:
       - bcolloran@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   about_home:
     bug_numbers:
       - 1271313
     description: >
       The count URI loads triggered in a subsession from about:home,
       broken down by the originating action.
     expires: "55"
     kind: uint
     keyed: true
     notification_emails:
       - bcolloran@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   about_newtab:
     bug_numbers:
       - 1271313
     description: >
       The count URI loads triggered in a subsession from about:newtab,
       broken down by the originating action.
     expires: "55"
     kind: uint
     keyed: true
     notification_emails:
       - bcolloran@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   contextmenu:
     bug_numbers:
       - 1271313
     description: >
       The count URI loads triggered in a subsession from the contextmenu,
       broken down by the originating action.
     expires: "55"
     kind: uint
     keyed: true
     notification_emails:
       - bcolloran@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
 # The following section is for probes testing the Telemetry system. They will not be
 # submitted in pings and are only used for testing.
 telemetry.test:
   unsigned_int_kind:
     bug_numbers:
       - 1276190
     description: >
       This is a test uint type with a really long description, maybe spanning even multiple
       lines, to just prove a point: everything works just fine.
     expires: never
     kind: uint
     notification_emails:
       - telemetry-client-dev@mozilla.com
+    record_in_processes:
+      - 'main'
 
   string_kind:
     bug_numbers:
       - 1276190
     description: A string test type with a one line comment that works just fine!
     expires: never
     kind: string
     notification_emails:
       - telemetry-client-dev@mozilla.com
+    record_in_processes:
+      - 'main'
 
   boolean_kind:
     bug_numbers:
       - 1281214
     description: A boolean test type with a one line comment that works just fine!
     expires: never
     kind: boolean
     notification_emails:
       - telemetry-client-dev@mozilla.com
+    record_in_processes:
+      - 'main'
 
   expired:
     bug_numbers:
       - 1276190
     description: This is an expired testing scalar; not meant to be touched.
     expires: 4.0a1
     kind: uint
     notification_emails:
       - telemetry-client-dev@mozilla.com
+    record_in_processes:
+      - 'main'
 
   unexpired:
     bug_numbers:
       - 1276190
     description: This is an unexpired testing scalar; not meant to be touched.
     expires: "375.0"
     kind: uint
     notification_emails:
       - telemetry-client-dev@mozilla.com
+    record_in_processes:
+      - 'main'
 
   release_optin:
     bug_numbers:
       - 1276190
     description: A testing scalar; not meant to be touched.
     expires: never
     kind: uint
     notification_emails:
       - telemetry-client-dev@mozilla.com
     release_channel_collection: opt-in
+    record_in_processes:
+      - 'main'
 
   release_optout:
     bug_numbers:
       - 1276190
     description: A testing scalar; not meant to be touched.
     expires: never
     kind: uint
     notification_emails:
       - telemetry-client-dev@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   keyed_release_optin:
     bug_numbers:
       - 1277806
     description: A testing scalar; not meant to be touched.
     expires: never
     kind: uint
     keyed: true
     notification_emails:
       - telemetry-client-dev@mozilla.com
     release_channel_collection: opt-in
+    record_in_processes:
+      - 'main'
 
   keyed_release_optout:
     bug_numbers:
       - 1277806
     description: A testing scalar; not meant to be touched.
     expires: never
     kind: uint
     keyed: true
     notification_emails:
       - telemetry-client-dev@mozilla.com
     release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
   keyed_expired:
     bug_numbers:
       - 1277806
     description: This is an expired testing scalar; not meant to be touched.
     expires: 4.0a1
     kind: uint
     keyed: true
     notification_emails:
       - telemetry-client-dev@mozilla.com
+    record_in_processes:
+      - 'main'
 
   keyed_unsigned_int:
     bug_numbers:
       - 1277806
     description: A testing keyed uint scalar; not meant to be touched.
     expires: never
     kind: uint
     keyed: true
     notification_emails:
       - telemetry-client-dev@mozilla.com
+    record_in_processes:
+      - 'main'
 
   keyed_boolean_kind:
     bug_numbers:
       - 1277806
     description: A testing keyed boolean scalar; not meant to be touched.
     expires: never
     kind: boolean
     keyed: true
--- a/toolkit/components/telemetry/docs/collection/scalars.rst
+++ b/toolkit/components/telemetry/docs/collection/scalars.rst
@@ -94,30 +94,30 @@ A probe can be defined as follows:
 Required Fields
 ---------------
 
 - ``bug_numbers``: A list of unsigned integers representing the number of the bugs the probe was introduced in.
 - ``description``: A single or multi-line string describing what data the probe collects and when it gets collected.
 - ``expires``: The version number in which the scalar expires, e.g. "30"; a version number of type "N" and "N.0" is automatically converted to "N.0a1" in order to expire the scalar also in the development channels. A telemetry probe acting on an expired scalar will print a warning into the browser console. For scalars that never expire the value ``never`` can be used.
 - ``kind``: A string representing the scalar type. Allowed values are ``uint``, ``string`` and ``boolean``.
 - ``notification_emails``: A list of email addresses to notify with alerts of expiring probes. More importantly, these are used by the data steward to verify that the probe is still useful.
+- ``record_in_processes``: A list of processes the scalar is allowed to record in. Currently supported values are:
+
+  - ``main``;
+  - ``content``;
+  - ``gpu``;
+  - ``all_child`` (record in all the child processes);
+  - ``all`` (record in all the processes).
 
 Optional Fields
 ---------------
 
 - ``cpp_guard``: A string that gets inserted as an ``#ifdef`` directive around the automatically generated C++ declaration. This is typically used for platform-specific scalars, e.g. ``ANDROID``.
 - ``release_channel_collection``: This can be either ``opt-in`` (default) or ``opt-out``. With the former the scalar is submitted by default on pre-release channels; on the release channel only if the user opted into additional data collection. With the latter the scalar is submitted by default on release and pre-release channels, unless the user opted out.
 - ``keyed``: A boolean that determines whether this is a keyed scalar. It defaults to ``False``.
-- ``record_in_processes``: A list of processes the scalar is allowed to record in. Currently supported values are:
-
-  - ``main`` (the default value);
-  - ``content``;
-  - ``gpu``;
-  - ``all_child`` (record in all the child processes);
-  - ``all`` (record in all the processes).
 
 String type restrictions
 ------------------------
 To prevent abuses, the content of a string scalar is limited to 50 characters in length. Trying
 to set a longer string will result in an error and no string being set.
 
 Keyed Scalars
 -------------
--- a/toolkit/components/telemetry/parse_scalars.py
+++ b/toolkit/components/telemetry/parse_scalars.py
@@ -86,24 +86,24 @@ class ScalarType:
         """
 
         # The required and optional fields in a scalar type definition.
         REQUIRED_FIELDS = {
             'bug_numbers': list, # This contains ints. See LIST_FIELDS_CONTENT.
             'description': basestring,
             'expires': basestring,
             'kind': basestring,
-            'notification_emails': list # This contains strings. See LIST_FIELDS_CONTENT.
+            'notification_emails': list, # This contains strings. See LIST_FIELDS_CONTENT.
+            'record_in_processes': list,
         }
 
         OPTIONAL_FIELDS = {
             'cpp_guard': basestring,
             'release_channel_collection': basestring,
             'keyed': bool,
-            'record_in_processes': list,
         }
 
         # The types for the data within the fields that hold lists.
         LIST_FIELDS_CONTENT = {
             'bug_numbers': int,
             'notification_emails': basestring,
             'record_in_processes': basestring,
         }
@@ -224,17 +224,17 @@ class ScalarType:
     @property
     def notification_emails(self):
         """Get the list of notification emails"""
         return self._definition['notification_emails']
 
     @property
     def record_in_processes(self):
         """Get the non-empty list of processes to record data in"""
-        return self._definition.get('record_in_processes', ['main'])
+        return self._definition['record_in_processes']
 
     @property
     def record_in_processes_enum(self):
         """Get the non-empty list of flags representing the processes to record data in"""
         return [KNOWN_PROCESS_FLAGS.get(p) for p in self.record_in_processes]
 
     @property
     def dataset(self):