Bug 1395835 - Rename "group" to "category" in the scalar code and docs. r=chutten
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Wed, 27 Sep 2017 10:12:13 +0200
changeset 383284 4413d40813bb1a3de51e743431dbbfec3c9cdd3e
parent 383283 7a9240b488a2c9cd7ec133103a700c94587f9983
child 383285 8189e90aad8efbb9737a5ff55437ad7f19405885
push id95539
push userkwierso@gmail.com
push dateThu, 28 Sep 2017 00:01:12 +0000
treeherdermozilla-inbound@72de90e66155 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten
bugs1395835
milestone58.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 1395835 - Rename "group" to "category" in the scalar code and docs. r=chutten MozReview-Commit-ID: HQ3I2cfEaa
toolkit/components/telemetry/Scalars.yaml
toolkit/components/telemetry/Telemetry.cpp
toolkit/components/telemetry/TelemetryScalar.cpp
toolkit/components/telemetry/TelemetryScalar.h
toolkit/components/telemetry/docs/collection/scalars.rst
toolkit/components/telemetry/nsITelemetry.idl
toolkit/components/telemetry/parse_scalars.py
toolkit/components/telemetry/tests/browser/browser_DynamicScalars.js
toolkit/components/telemetry/tests/unit/test_TelemetryScalars.js
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -1272,10 +1272,10 @@ telemetry.test:
     expires: never
     kind: string
     notification_emails:
       - telemetry-client-dev@mozilla.com
     record_in_processes:
       - 'all_childs'
 
 # NOTE: Please don't add new definitions below this point. Consider adding
-# them earlier in the file and leave the telemetry.test group as the last
+# them earlier in the file and leave the telemetry.test category as the last
 # one for readability.
--- a/toolkit/components/telemetry/Telemetry.cpp
+++ b/toolkit/components/telemetry/Telemetry.cpp
@@ -1689,21 +1689,21 @@ NS_IMETHODIMP
 TelemetryImpl::SnapshotKeyedScalars(unsigned int aDataset, bool aClearScalars, JSContext* aCx,
                                     uint8_t optional_argc, JS::MutableHandleValue aResult)
 {
   return TelemetryScalar::CreateKeyedSnapshots(aDataset, aClearScalars, aCx, optional_argc,
                                                aResult);
 }
 
 NS_IMETHODIMP
-TelemetryImpl::RegisterScalars(const nsACString& aGroupName,
+TelemetryImpl::RegisterScalars(const nsACString& aCategoryName,
                                JS::Handle<JS::Value> aScalarData,
                                JSContext* cx)
 {
-  return TelemetryScalar::RegisterScalars(aGroupName, aScalarData, cx);
+  return TelemetryScalar::RegisterScalars(aCategoryName, aScalarData, cx);
 }
 
 NS_IMETHODIMP
 TelemetryImpl::ClearScalars()
 {
   TelemetryScalar::ClearScalars();
   return NS_OK;
 }
--- a/toolkit/components/telemetry/TelemetryScalar.cpp
+++ b/toolkit/components/telemetry/TelemetryScalar.cpp
@@ -86,20 +86,20 @@ namespace TelemetryIPCAccumulator = mozi
 //
 // PRIVATE TYPES
 
 namespace {
 
 const uint32_t kMaximumNumberOfKeys = 100;
 const uint32_t kMaximumKeyStringLength = 70;
 const uint32_t kMaximumStringValueLength = 50;
-// The group and scalar name maximum lengths are used by the dynamic
+// The category and scalar name maximum lengths are used by the dynamic
 // scalar registration function and must match the constants used by
 // the 'parse_scalars.py' script for static scalars.
-const uint32_t kMaximumGroupNameLength = 40;
+const uint32_t kMaximumCategoryNameLength = 40;
 const uint32_t kMaximumScalarNameLength = 40;
 const uint32_t kScalarCount =
   static_cast<uint32_t>(mozilla::Telemetry::ScalarID::ScalarCount);
 
 enum class ScalarResult : uint8_t {
   // Nothing went wrong.
   Ok,
   // General Scalar Errors
@@ -2046,17 +2046,17 @@ TelemetryScalar::SetMaximum(mozilla::Tel
   }
 
   scalar->SetMaximum(aKey, aValue);
 }
 
 /**
  * Serializes the scalars from the given dataset to a json-style object and resets them.
  * The returned structure looks like:
- *    {"process": {"group1.probe":1,"group1.other_probe":false,...}, ... }.
+ *    {"process": {"category1.probe":1,"category1.other_probe":false,...}, ... }.
  *
  * @param aDataset DATASET_RELEASE_CHANNEL_OPTOUT or DATASET_RELEASE_CHANNEL_OPTIN.
  * @param aClear Whether to clear out the scalars after snapshotting.
  */
 nsresult
 TelemetryScalar::CreateSnapshots(unsigned int aDataset, bool aClearScalars, JSContext* aCx,
                                  uint8_t optional_argc, JS::MutableHandle<JS::Value> aResult)
 {
@@ -2153,17 +2153,17 @@ TelemetryScalar::CreateSnapshots(unsigne
   }
 
   return NS_OK;
 }
 
 /**
  * Serializes the scalars from the given dataset to a json-style object and resets them.
  * The returned structure looks like:
- *   { "process": { "group1.probe": { "key_1": 2, "key_2": 1, ... }, ... }, ... }
+ *   { "process": { "category1.probe": { "key_1": 2, "key_2": 1, ... }, ... }, ... }
  *
  * @param aDataset DATASET_RELEASE_CHANNEL_OPTOUT or DATASET_RELEASE_CHANNEL_OPTIN.
  * @param aClear Whether to clear out the keyed scalars after snapshotting.
  */
 nsresult
 TelemetryScalar::CreateKeyedSnapshots(unsigned int aDataset, bool aClearScalars, JSContext* aCx,
                                       uint8_t optional_argc, JS::MutableHandle<JS::Value> aResult)
 {
@@ -2275,26 +2275,26 @@ TelemetryScalar::CreateKeyedSnapshots(un
       }
     }
   }
 
   return NS_OK;
 }
 
 nsresult
-TelemetryScalar::RegisterScalars(const nsACString& aGroupName,
+TelemetryScalar::RegisterScalars(const nsACString& aCategoryName,
                                  JS::Handle<JS::Value> aScalarData,
                                  JSContext* cx)
 {
   MOZ_ASSERT(XRE_IsParentProcess(),
              "Dynamic scalars should only be created in the parent process.");
 
-  if (!IsValidIdentifierString(aGroupName, kMaximumGroupNameLength, true, false)) {
-    JS_ReportErrorASCII(cx, "Invalid group name %s.",
-                        PromiseFlatCString(aGroupName).get());
+  if (!IsValidIdentifierString(aCategoryName, kMaximumCategoryNameLength, true, false)) {
+    JS_ReportErrorASCII(cx, "Invalid category name %s.",
+                        PromiseFlatCString(aCategoryName).get());
     return NS_ERROR_INVALID_ARG;
   }
 
   if (!aScalarData.isObject()) {
     JS_ReportErrorASCII(cx, "Scalar data parameter should be an object");
     return NS_ERROR_INVALID_ARG;
   }
 
@@ -2317,19 +2317,19 @@ TelemetryScalar::RegisterScalars(const n
 
     if (!IsValidIdentifierString(NS_ConvertUTF16toUTF8(scalarName), kMaximumScalarNameLength,
                                  false, true)) {
       JS_ReportErrorASCII(cx, "Invalid scalar name %s.",
                           PromiseFlatCString(NS_ConvertUTF16toUTF8(scalarName)).get());
       return NS_ERROR_INVALID_ARG;
     }
 
-    // Join the group and the probe names.
+    // Join the category and the probe names.
     nsPrintfCString fullName("%s.%s",
-                             PromiseFlatCString(aGroupName).get(),
+                             PromiseFlatCString(aCategoryName).get(),
                              NS_ConvertUTF16toUTF8(scalarName).get());
 
     JS::RootedValue value(cx);
     if (!JS_GetPropertyById(cx, obj, scalarPropertyIds[i], &value) || !value.isObject()) {
       return NS_ERROR_FAILURE;
     }
     JS::RootedObject scalarDef(cx, &value.toObject());
 
--- a/toolkit/components/telemetry/TelemetryScalar.h
+++ b/toolkit/components/telemetry/TelemetryScalar.h
@@ -50,17 +50,17 @@ void Set(mozilla::Telemetry::ScalarID aI
 void SetMaximum(mozilla::Telemetry::ScalarID aId, uint32_t aValue);
 
 // Keyed C++ API Endpoints.
 void Add(mozilla::Telemetry::ScalarID aId, const nsAString& aKey, uint32_t aValue);
 void Set(mozilla::Telemetry::ScalarID aId, const nsAString& aKey, uint32_t aValue);
 void Set(mozilla::Telemetry::ScalarID aId, const nsAString& aKey, bool aValue);
 void SetMaximum(mozilla::Telemetry::ScalarID aId, const nsAString& aKey, uint32_t aValue);
 
-nsresult RegisterScalars(const nsACString& aGroupName, JS::Handle<JS::Value> aScalarData,
+nsresult RegisterScalars(const nsACString& aCategoryName, JS::Handle<JS::Value> aScalarData,
                          JSContext* cx);
 
 // Only to be used for testing.
 void ClearScalars();
 
 size_t GetMapShallowSizesOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf);
 size_t GetScalarSizesOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
 
--- a/toolkit/components/telemetry/docs/collection/scalars.rst
+++ b/toolkit/components/telemetry/docs/collection/scalars.rst
@@ -34,51 +34,51 @@ These functions can throw if, for exampl
 (e.g. calling scalarSetMaximum on a scalar of the string kind). Please look at the `code documentation <https://dxr.mozilla.org/mozilla-central/search?q=regexp%3ATelemetryScalar%3A%3A(Set%7CAdd)+file%3ATelemetryScalar.cpp&redirect=false>`_ for
 additional information.
 
 ``registerScalars()``
 ~~~~~~~~~~~~~~~~~~~~~
 
 .. code-block:: js
 
-  Services.telemetry.registerScalars(group, scalarData);
+  Services.telemetry.registerScalars(category, scalarData);
 
 Register new scalars from add-ons.
 
-* ``group`` - *(required, string)* The unique group the scalars are registered in (see :ref:`limitations <scalar-limitations>`).
+* ``category`` - *(required, string)* The unique category the scalars are registered in (see :ref:`limitations <scalar-limitations>`).
 * ``scalarData`` - *(required, object)* An object of the form ``{scalarName1: scalar1Data, ...}`` that contains registration data for multiple scalars; ``scalarName1`` is subject to :ref:`limitations <scalar-limitations>`; each scalar is an object with the following properties:
 
   * ``kind`` - *(required, uint)*  One of the scalar types (nsITelemetry::SCALAR_TYPE_*).
   * ``keyed`` - *(optional, bool)* Whether this is a keyed scalar or not. Defaults to false.
   * ``record_on_release`` - *(optional, bool)* Whether to record this data on release. Defaults to false.
   * ``expired`` - *(optional, bool)* Whether this scalar entry is expired. This allows recording it without error, but it will be discarded. Defaults to false.
 
 For scalars recorded from add-ons, registration happens at runtime. Any new scalar must first be registered through this function before they can be recorded.
 
 After registration, the scalars can be recorded through the usual scalar JS API. If the accumulation happens in a content process right after the registration and the definition still has to reach this process, it will be discarded: one way to work around the problem is to send an IPC message to the content process and start accumulating data once this message has been received. The accumulated data will be submitted in the main pings payload under ``processes.dynamic.scalars``.
 
 .. note::
 
     Accumulating in dynamic scalars only works in content child processes and in the parent process. All the accumulations (parent and content chldren) are aggregated together .
 
-New scalars registered here are subject to the same :ref:`limitations <scalar-limitations>` as the ones registered through ``Scalars.yaml``, e.g. the length of the group name or the allowed characters.
+New scalars registered here are subject to the same :ref:`limitations <scalar-limitations>` as the ones registered through ``Scalars.yaml``, e.g. the length of the category name or the allowed characters.
 
 Example:
 
 .. code-block:: js
 
-  Services.telemetry.registerScalars("myAddon.group", {
+  Services.telemetry.registerScalars("myAddon.category", {
     "counter_scalar": {
       kind: Ci.nsITelemetry.SCALAR_TYPE_COUNT,
       keyed: false,
       record_on_release: false
     },
   });
   // Now scalars can be recorded.
-  Services.telemetry.scalarSet("myAddon.group.counter_scalar", 37);
+  Services.telemetry.scalarSet("myAddon.category.counter_scalar", 37);
 
 C++ API
 -------
 Probes in native code can use the more convenient helper functions declared in `Telemetry.h <https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/Telemetry.h>`_:
 
 .. code-block:: cpp
 
     void ScalarAdd(mozilla::Telemetry::ScalarID aId, uint32_t aValue);
@@ -101,43 +101,43 @@ The YAML definition file
 Scalar probes are required to be registered, both for validation and transparency reasons,
 in the `Scalars.yaml <https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/Scalars.yaml>`_
 definition file.
 
 The probes in the definition file are represented in a fixed-depth, two-level structure:
 
 .. code-block:: yaml
 
-    # The following is a group.
-    a.group.hierarchy:
+    # The following is a category.
+    a.category.hierarchy:
       a_probe_name:
         kind: uint
         ...
       another_probe:
         kind: string
         ...
       ...
-    group2:
+    category2:
       probe:
         kind: int
         ...
 
 .. _scalar-limitations:
 
-Group and probe names need to follow a few rules:
+Category and probe names need to follow a few rules:
 
 - they cannot exceed 40 characters each;
-- group names must be alpha-numeric + ``.``, with no leading/trailing digit or ``.``;
+- category names must be alpha-numeric + ``.``, with no leading/trailing digit or ``.``;
 - probe names must be alpha-numeric + ``_``, with no leading/trailing digit or ``_``.
 
 A probe can be defined as follows:
 
 .. code-block:: yaml
 
-    a.group.hierarchy:
+    a.category.hierarchy:
       a_scalar:
         bug_numbers:
           - 1276190
         description: A nice one-line description.
         expires: never
         kind: uint
         notification_emails:
           - telemetry-client-dev@mozilla.com
--- a/toolkit/components/telemetry/nsITelemetry.idl
+++ b/toolkit/components/telemetry/nsITelemetry.idl
@@ -350,17 +350,17 @@ interface nsITelemetry : nsISupports
    * @param aValue The numeric value to set the scalar to. Only unsigned integers supported.
    */
   [implicit_jscontext]
   void scalarSetMaximum(in ACString aName, in jsval aValue);
 
   /**
    * Serializes the scalars from the given dataset to a JSON-style object and resets them.
    * The returned structure looks like:
-   *   {"process": {"group1.probe":1,"group1.other_probe":false,...}, ... }.
+   *   {"process": {"category1.probe":1,"category1.other_probe":false,...}, ... }.
    *
    * @param aDataset DATASET_RELEASE_CHANNEL_OPTOUT or DATASET_RELEASE_CHANNEL_OPTIN.
    * @param [aClear=false] Whether to clear out the scalars after snapshotting.
    */
   [implicit_jscontext, optional_argc]
   jsval snapshotScalars(in uint32_t aDataset, [optional] in boolean aClear);
 
   /**
@@ -393,17 +393,17 @@ interface nsITelemetry : nsISupports
    */
   [implicit_jscontext]
   void keyedScalarSetMaximum(in ACString aName, in AString aKey, in jsval aValue);
 
   /**
    * Serializes the keyed scalars from the given dataset to a JSON-style object and
    * resets them.
    * The returned structure looks like:
-   *   { "process": { "group1.probe": { "key_1": 2, "key_2": 1, ... }, ... }, ... }
+   *   { "process": { "category1.probe": { "key_1": 2, "key_2": 1, ... }, ... }, ... }
    *
    * @param aDataset DATASET_RELEASE_CHANNEL_OPTOUT or DATASET_RELEASE_CHANNEL_OPTIN.
    * @param [aClear=false] Whether to clear out the scalars after snapshotting.
    */
   [implicit_jscontext, optional_argc]
   jsval snapshotKeyedScalars(in uint32_t aDataset, [optional] in boolean aClear);
 
   /**
@@ -483,21 +483,21 @@ interface nsITelemetry : nsISupports
    * @param aEventData.<name>.expired Optional, whether this event entry is expired. This allows
    *                                  recording it without error, but it will be discarded. Defaults to false.
    */
   [implicit_jscontext]
   void registerEvents(in ACString aCategory, in jsval aEventData);
 
   /**
    * Parent process only. Register new scalars to record them from addons. This
-   * allows registering multiple scalars for a group. They will be valid only for
+   * allows registering multiple scalars for a category. They will be valid only for
    * the current Firefox session.
    * Note that scalars shipping in Firefox should be registered in Scalars.yaml.
    *
-   * @param aGroupName The unique group the scalars are registered in.
+   * @param aCategoryName The unique category the scalars are registered in.
    * @param aScalarData An object that contains registration data for multiple scalars in the form:
    *   {
    *     "sample_scalar": {
    *       "kind": Ci.nsITelemetry.SCALAR_TYPE_COUNT,
    *       "keyed": true, //optional, defaults to false
    *       "record_on_release: true, // optional, defaults to false
    *       "expired": false // optional, defaults to false.
    *     },
@@ -506,15 +506,15 @@ interface nsITelemetry : nsISupports
    * @param aScalarData.<name>.kind One of the scalar types defined in this file (SCALAR_TYPE_*)
    * @param aScalarData.<name>.keyed Optional, whether this is a keyed scalar or not. Defaults to false.
    * @param aScalarData.<name>.record_on_release Optional, whether to record this data on release.
    *                                             Defaults to false.
    * @param aScalarData.<name>.expired Optional, whether this scalar entry is expired. This allows
    *                                   recording it without error, but it will be discarded. Defaults to false.
    */
   [implicit_jscontext]
-  void registerScalars(in ACString aGroupName, in jsval aScalarData);
+  void registerScalars(in ACString aCategoryName, in jsval aScalarData);
 
   /**
    * Resets all the stored events. This is intended to be only used in tests.
    */
   void clearEvents();
 };
--- a/toolkit/components/telemetry/parse_scalars.py
+++ b/toolkit/components/telemetry/parse_scalars.py
@@ -19,46 +19,46 @@ SCALAR_TYPES_MAP = {
     'string': 'nsITelemetry::SCALAR_TYPE_STRING',
     'boolean': 'nsITelemetry::SCALAR_TYPE_BOOLEAN'
 }
 
 
 class ScalarType:
     """A class for representing a scalar definition."""
 
-    def __init__(self, group_name, probe_name, definition, strict_type_checks):
+    def __init__(self, category_name, probe_name, definition, strict_type_checks):
         # Validate and set the name, so we don't need to pass it to the other
         # validation functions.
         self._strict_type_checks = strict_type_checks
-        self.validate_names(group_name, probe_name)
+        self.validate_names(category_name, probe_name)
         self._name = probe_name
-        self._group_name = group_name
+        self._category_name = category_name
 
         # Validating the scalar definition.
         self.validate_types(definition)
         self.validate_values(definition)
 
         # Everything is ok, set the rest of the data.
         self._definition = definition
         self._expires = utils.add_expiration_postfix(definition['expires'])
 
-    def validate_names(self, group_name, probe_name):
-        """Validate the group and probe name:
-            - Group name must be alpha-numeric + '.', no leading/trailing digit or '.'.
+    def validate_names(self, category_name, probe_name):
+        """Validate the category and probe name:
+            - Category name must be alpha-numeric + '.', no leading/trailing digit or '.'.
             - Probe name must be alpha-numeric + '_', no leading/trailing digit or '_'.
 
-        :param group_name: the name of the group the probe is in.
+        :param category_name: the name of the category the probe is in.
         :param probe_name: the name of the scalar probe.
         :raises ParserError: if the length of the names exceeds the limit or they don't
                 conform our name specification.
         """
 
-        # Enforce a maximum length on group and probe names.
+        # Enforce a maximum length on category and probe names.
         MAX_NAME_LENGTH = 40
-        for n in [group_name, probe_name]:
+        for n in [category_name, probe_name]:
             if len(n) > MAX_NAME_LENGTH:
                 raise ParserError(("Name '{}' exceeds maximum name length of {} characters.\n"
                                    "See: {}#the-yaml-definition-file")
                                   .format(n, MAX_NAME_LENGTH, BASE_DOC_URL))
 
         def check_name(name, error_msg_prefix, allowed_char_regexp):
             # Check if we only have the allowed characters.
             chars_regxp = r'^[a-zA-Z0-9' + allowed_char_regexp + r']+$'
@@ -67,17 +67,17 @@ class ScalarType:
                                   "See: {}#the-yaml-definition-file").format(name, BASE_DOC_URL))
 
             # Don't allow leading/trailing digits, '.' or '_'.
             if re.search(r'(^[\d\._])|([\d\._])$', name):
                 raise ParserError((error_msg_prefix + " name must not have a leading/trailing "
                                    "digit, a dot or underscore. Got: '{}'.\n"
                                    " See: {}#the-yaml-definition-file").format(name, BASE_DOC_URL))
 
-        check_name(group_name, 'Group', r'\.')
+        check_name(category_name, 'Category', r'\.')
         check_name(probe_name, 'Probe', r'_')
 
     def validate_types(self, definition):
         """This function performs some basic sanity checks on the scalar definition:
             - Checks that all the required fields are available.
             - Checks that all the fields have the expected types.
 
         :param definition: the dictionary containing the scalar properties.
@@ -197,22 +197,22 @@ class ScalarType:
 
     @property
     def name(self):
         """Get the scalar name"""
         return self._name
 
     @property
     def label(self):
-        """Get the scalar label generated from the scalar and group names."""
-        return self._group_name + '.' + self._name
+        """Get the scalar label generated from the scalar and category names."""
+        return self._category_name + '.' + self._name
 
     @property
     def enum_label(self):
-        """Get the enum label generated from the scalar and group names. This is used to
+        """Get the enum label generated from the scalar and category names. This is used to
         generate the enum tables."""
 
         # The scalar name can contain informations about its hierarchy (e.g. 'a.b.scalar').
         # We can't have dots in C++ enums, replace them with an underscore. Also, make the
         # label upper case for consistency with the histogram enums.
         return self.label.replace('.', '_').upper()
 
     @property
@@ -298,24 +298,25 @@ def load_scalars(filename, strict_type_c
         raise ParserError('Error opening ' + filename + ': ' + e.message)
     except ValueError, e:
         raise ParserError('Error parsing scalars in {}: {}'
                           '.\nSee: {}'.format(filename, e.message, BASE_DOC_URL))
 
     scalar_list = []
 
     # Scalars are defined in a fixed two-level hierarchy within the definition file.
-    # The first level contains the group name, while the second level contains the
-    # probe name (e.g. "group.name: probe: ...").
-    for group_name in scalars:
-        group = scalars[group_name]
+    # The first level contains the category name, while the second level contains the
+    # probe name (e.g. "category.name: probe: ...").
+    for category_name in scalars:
+        category = scalars[category_name]
 
-        # Make sure that the group has at least one probe in it.
-        if not group or len(group) == 0:
+        # Make sure that the category has at least one probe in it.
+        if not category or len(category) == 0:
             raise ParserError('Category "{}" must have at least one probe in it' +
-                              '.\nSee: {}'.format(group_name, BASE_DOC_URL))
+                              '.\nSee: {}'.format(category_name, BASE_DOC_URL))
 
-        for probe_name in group:
+        for probe_name in category:
             # We found a scalar type. Go ahead and parse it.
-            scalar_info = group[probe_name]
-            scalar_list.append(ScalarType(group_name, probe_name, scalar_info, strict_type_checks))
+            scalar_info = category[probe_name]
+            scalar_list.append(
+                ScalarType(category_name, probe_name, scalar_info, strict_type_checks))
 
     return scalar_list
--- a/toolkit/components/telemetry/tests/browser/browser_DynamicScalars.js
+++ b/toolkit/components/telemetry/tests/browser/browser_DynamicScalars.js
@@ -102,17 +102,17 @@ add_task(async function test_recording()
 });
 
 add_task(async function test_aggregation() {
   Services.telemetry.clearScalars();
 
   // Register test scalars before spawning the content process: the scalar
   // definitions will propagate to it. Also cheat TelemetrySession to put
   // the test scalar in the payload by using "cheattest" instead of "test" in
-  // the scalar group name.
+  // the scalar category name.
   Services.telemetry.registerScalars("telemetry.cheattest.dynamic", {
     "test_aggregation": {
       kind: Ci.nsITelemetry.SCALAR_TYPE_COUNT,
       keyed: false,
       record_on_release: true
     },
   });
 
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryScalars.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryScalars.js
@@ -536,89 +536,89 @@ add_task(async function test_keyed_max_k
   });
 });
 
 add_task(function* test_dynamicScalars_registration() {
   Telemetry.clearScalars();
 
   const TEST_CASES = [
     {
-      "group": "telemetry.test",
+      "category": "telemetry.test",
       "data": {
         "missing_kind": {
           keyed: false,
           record_on_release: true
         },
       },
       "evaluation": /missing 'kind'/,
       "description": "Registration must fail if required fields are missing"
     },
     {
-      "group": "telemetry.test",
+      "category": "telemetry.test",
       "data": {
         "invalid_collection": {
           kind: Ci.nsITelemetry.SCALAR_TYPE_COUNT,
           record_on_release: "opt-in"
         },
       },
       "evaluation": /Invalid 'record_on_release'/,
       "description": "Registration must fail if 'record_on_release' is of the wrong type"
     },
     {
-      "group": "telemetry.test",
+      "category": "telemetry.test",
       "data": {
         "invalid_kind": {
           kind: "12",
         },
       },
       "evaluation": /Invalid or missing 'kind'/,
       "description": "Registration must fail if 'kind' is of the wrong type"
     },
     {
-      "group": "telemetry.test",
+      "category": "telemetry.test",
       "data": {
         "invalid_expired": {
           kind: Ci.nsITelemetry.SCALAR_TYPE_COUNT,
           expired: "never",
         },
       },
       "evaluation": /Invalid 'expired'/,
       "description": "Registration must fail if 'expired' is of the wrong type"
     },
     {
-      "group": "telemetry.test",
+      "category": "telemetry.test",
       "data": {
         "valid_scalar": {
           kind: Ci.nsITelemetry.SCALAR_TYPE_COUNT,
           keyed: false,
           record_on_release: true
         },
         "invalid_scalar": {
           expired: false,
         },
       },
       "evaluation": /Invalid or missing 'kind'/,
       "description": "No scalar must be registered if the batch contains an invalid one"
     },
     {
-      "group": "telemetry.test",
+      "category": "telemetry.test",
       "data": {
         "unsigned_int_kind": {
           kind: Ci.nsITelemetry.SCALAR_TYPE_COUNT,
           keyed: false,
           record_on_release: true
         },
       },
       "evaluation": /already registered/,
       "description": "Registration must fail if a scalar with the same name exists already"
     },
   ];
 
   for (let testCase of TEST_CASES) {
-    Assert.throws(() => Telemetry.registerScalars(testCase.group, testCase.data),
+    Assert.throws(() => Telemetry.registerScalars(testCase.category, testCase.data),
                   testCase.evaluation, testCase.description);
   }
 });
 
 add_task(function* test_dynamicScalars_recording() {
   Telemetry.clearScalars();
 
   // Disable extended recording so that we will just record opt-out.