Bug 1278247 - Enforce consistent naming for Telemetry gen-* python scripts. r=Dexter
authorRyan Leake <leaker2@uni.coventry.ac.uk>
Wed, 22 Nov 2017 12:09:33 +0000
changeset 437975 85d8bab6cc6fcffa0ef3892c7937a4543269b5d6
parent 437974 f320e72a945f5f2c39c6a8fbddb30f3ada3834fe
child 437976 6b12bcdb97e0bb01f430405620844c8c9e202b90
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersDexter
bugs1278247
milestone59.0a1
Bug 1278247 - Enforce consistent naming for Telemetry gen-* python scripts. r=Dexter MozReview-Commit-ID: C5HM3Piy2QL
toolkit/components/telemetry/docs/collection/histograms.rst
toolkit/components/telemetry/docs/collection/scalars.rst
toolkit/components/telemetry/gen-event-data.py
toolkit/components/telemetry/gen-event-enum.py
toolkit/components/telemetry/gen-histogram-data.py
toolkit/components/telemetry/gen-histogram-enum.py
toolkit/components/telemetry/gen-process-data.py
toolkit/components/telemetry/gen-process-enum.py
toolkit/components/telemetry/gen-scalar-data.py
toolkit/components/telemetry/gen-scalar-enum.py
toolkit/components/telemetry/gen_event_data.py
toolkit/components/telemetry/gen_event_enum.py
toolkit/components/telemetry/gen_histogram_data.py
toolkit/components/telemetry/gen_histogram_enum.py
toolkit/components/telemetry/gen_process_data.py
toolkit/components/telemetry/gen_process_enum.py
toolkit/components/telemetry/gen_scalar_data.py
toolkit/components/telemetry/gen_scalar_enum.py
toolkit/components/telemetry/moz.build
--- a/toolkit/components/telemetry/docs/collection/histograms.rst
+++ b/toolkit/components/telemetry/docs/collection/histograms.rst
@@ -95,17 +95,17 @@ Note that when you need to record for a 
 
 .. warning::
 
     Keyed histograms are currently not supported in the `histogram change detector <https://alerts.telemetry.mozilla.org/index.html>`_.
 
 Declaring a Histogram
 =====================
 
-Histograms should be declared in the `Histograms.json <https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/Histograms.json>`_ file. These declarations are checked for correctness at `compile time <https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/gen-histogram-data.py>`_ and used to generate C++ code.
+Histograms should be declared in the `Histograms.json <https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/Histograms.json>`_ file. These declarations are checked for correctness at `compile time <https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/gen_histogram_data.py>`_ and used to generate C++ code.
 
 The following is a sample histogram declaration from ``Histograms.json`` for a histogram named ``MEMORY_RESIDENT`` which tracks the amount of resident memory used by a process:
 
 
 .. code-block:: json
 
     "MEMORY_RESIDENT": {
       "record_in_processes": ["main", "content"],
--- a/toolkit/components/telemetry/docs/collection/scalars.rst
+++ b/toolkit/components/telemetry/docs/collection/scalars.rst
@@ -184,24 +184,24 @@ When recording data in different process
 Races can happen because scalar changes are sent from each child process to the parent process, and then merged into the final storage location. Since there's no synchronization between the processes, operations like ``setMaximum`` can potentially produce different results if sent from more than one child process.
 
 The processor scripts
 =====================
 The scalar definition file is processed and checked for correctness at compile time. If it
 conforms to the specification, the processor scripts generate two C++ headers files, included
 by the Telemetry C++ core.
 
-gen-scalar-data.py
+gen_scalar_data.py
 ------------------
 This script is called by the build system to generate the ``TelemetryScalarData.h`` C++ header
 file out of the scalar definitions.
 This header file contains an array holding the scalar names and version strings, in addition
 to an array of ``ScalarInfo`` structures representing all the scalars.
 
-gen-scalar-enum.py
+gen_scalar_enum.py
 ------------------
 This script is called by the build system to generate the ``TelemetryScalarEnums.h`` C++ header
 file out of the scalar definitions.
 This header file contains an enum class with all the scalar identifiers used to access them
 from code through the C++ API.
 
 Adding a new probe
 ==================
rename from toolkit/components/telemetry/gen-event-data.py
rename to toolkit/components/telemetry/gen_event_data.py
--- a/toolkit/components/telemetry/gen-event-data.py
+++ b/toolkit/components/telemetry/gen_event_data.py
@@ -9,17 +9,17 @@ from __future__ import print_function
 from shared_telemetry_utils import StringTable, static_assert, ParserError
 
 import parse_events
 import sys
 import itertools
 
 # The banner/text at the top of the generated file.
 banner = """/* This file is auto-generated, only for internal use in TelemetryEvent.h,
-   see gen-event-data.py. */
+   see gen_event_data.py. */
 """
 
 file_header = """\
 #ifndef mozilla_TelemetryEventData_h
 #define mozilla_TelemetryEventData_h
 #include "EventInfo.h"
 namespace {
 """
rename from toolkit/components/telemetry/gen-event-enum.py
rename to toolkit/components/telemetry/gen_event_enum.py
--- a/toolkit/components/telemetry/gen-event-enum.py
+++ b/toolkit/components/telemetry/gen_event_enum.py
@@ -7,17 +7,17 @@
 # The events are defined in files provided as command-line arguments.
 
 from __future__ import print_function
 from shared_telemetry_utils import ParserError
 
 import sys
 import parse_events
 
-banner = """/* This file is auto-generated, see gen-event-enum.py.  */
+banner = """/* This file is auto-generated, see gen_event_enum.py.  */
 """
 
 file_header = """\
 #ifndef mozilla_TelemetryEventEnums_h
 #define mozilla_TelemetryEventEnums_h
 namespace mozilla {
 namespace Telemetry {
 namespace EventID {
rename from toolkit/components/telemetry/gen-histogram-data.py
rename to toolkit/components/telemetry/gen_histogram_data.py
--- a/toolkit/components/telemetry/gen-histogram-data.py
+++ b/toolkit/components/telemetry/gen_histogram_data.py
@@ -6,17 +6,17 @@
 # in a file provided as a command-line argument.
 
 from __future__ import print_function
 from shared_telemetry_utils import StringTable, static_assert, ParserError
 
 import sys
 import histogram_tools
 
-banner = """/* This file is auto-generated, see gen-histogram-data.py.  */
+banner = """/* This file is auto-generated, see gen_histogram_data.py.  */
 """
 
 
 def print_array_entry(output, histogram, name_index, exp_index, label_index,
                       label_count, key_index, key_count):
     cpp_guard = histogram.cpp_guard()
     if cpp_guard:
         print("#if defined(%s)" % cpp_guard, file=output)
rename from toolkit/components/telemetry/gen-histogram-enum.py
rename to toolkit/components/telemetry/gen_histogram_enum.py
--- a/toolkit/components/telemetry/gen-histogram-enum.py
+++ b/toolkit/components/telemetry/gen_histogram_enum.py
@@ -15,17 +15,17 @@
 from __future__ import print_function
 from shared_telemetry_utils import ParserError
 
 import histogram_tools
 import itertools
 import sys
 
 
-banner = """/* This file is auto-generated, see gen-histogram-enum.py.  */
+banner = """/* This file is auto-generated, see gen_histogram_enum.py.  */
 """
 
 header = """
 #ifndef mozilla_TelemetryHistogramEnums_h
 #define mozilla_TelemetryHistogramEnums_h
 
 #include "mozilla/TemplateLib.h"
 
rename from toolkit/components/telemetry/gen-process-data.py
rename to toolkit/components/telemetry/gen_process_data.py
--- a/toolkit/components/telemetry/gen-process-data.py
+++ b/toolkit/components/telemetry/gen_process_data.py
@@ -8,17 +8,17 @@
 from __future__ import print_function
 from shared_telemetry_utils import ParserError, load_yaml_file
 
 import sys
 import collections
 
 # The banner/text at the top of the generated file.
 banner = """/* This file is auto-generated from Telemetry build scripts,
-   see gen-processes-data.py. */
+   see gen_process_data.py. */
 """
 
 file_header = """\
 #ifndef mozilla_TelemetryProcessData_h
 #define mozilla_TelemetryProcessData_h
 
 #include "mozilla/TelemetryProcessEnums.h"
 
rename from toolkit/components/telemetry/gen-process-enum.py
rename to toolkit/components/telemetry/gen_process_enum.py
--- a/toolkit/components/telemetry/gen-process-enum.py
+++ b/toolkit/components/telemetry/gen_process_enum.py
@@ -8,17 +8,17 @@
 from __future__ import print_function
 from shared_telemetry_utils import ParserError, load_yaml_file
 
 import sys
 import collections
 
 # The banner/text at the top of the generated file.
 banner = """/* This file is auto-generated from Telemetry build scripts,
-   see gen-processes-enum.py. */
+   see gen_process_enum.py. */
 """
 
 file_header = """\
 #ifndef mozilla_TelemetryProcessEnums_h
 #define mozilla_TelemetryProcessEnums_h
 
 namespace mozilla {
 namespace Telemetry {
rename from toolkit/components/telemetry/gen-scalar-data.py
rename to toolkit/components/telemetry/gen_scalar_data.py
--- a/toolkit/components/telemetry/gen-scalar-data.py
+++ b/toolkit/components/telemetry/gen_scalar_data.py
@@ -8,17 +8,17 @@
 from __future__ import print_function
 from shared_telemetry_utils import StringTable, static_assert, ParserError
 
 import parse_scalars
 import sys
 
 # The banner/text at the top of the generated file.
 banner = """/* This file is auto-generated, only for internal use in TelemetryScalar.h,
-   see gen-scalar-data.py. */
+   see gen_scalar_data.py. */
 """
 
 file_header = """\
 #ifndef mozilla_TelemetryScalarData_h
 #define mozilla_TelemetryScalarData_h
 #include "ScalarInfo.h"
 namespace {
 """
rename from toolkit/components/telemetry/gen-scalar-enum.py
rename to toolkit/components/telemetry/gen_scalar_enum.py
--- a/toolkit/components/telemetry/gen-scalar-enum.py
+++ b/toolkit/components/telemetry/gen_scalar_enum.py
@@ -8,17 +8,17 @@
 # The scalars are defined in files provided as command-line arguments.
 
 from __future__ import print_function
 from shared_telemetry_utils import ParserError
 
 import sys
 import parse_scalars
 
-banner = """/* This file is auto-generated, see gen-scalar-enum.py.  */
+banner = """/* This file is auto-generated, see gen_scalar_enum.py.  */
 """
 
 file_header = """\
 #ifndef mozilla_TelemetryScalarEnums_h
 #define mozilla_TelemetryScalarEnums_h
 namespace mozilla {
 namespace Telemetry {
 enum class ScalarID : uint32_t {\
--- a/toolkit/components/telemetry/moz.build
+++ b/toolkit/components/telemetry/moz.build
@@ -120,56 +120,56 @@ GENERATED_FILES = [
 # Generate histogram files.
 histogram_files = [
     'Histograms.json',
     '/dom/base/UseCounters.conf',
     '/dom/base/nsDeprecatedOperationList.h',
 ]
 
 data = GENERATED_FILES['TelemetryHistogramData.inc']
-data.script = 'gen-histogram-data.py'
+data.script = 'gen_histogram_data.py'
 data.inputs = histogram_files
 
 enums = GENERATED_FILES['TelemetryHistogramEnums.h']
-enums.script = 'gen-histogram-enum.py'
+enums.script = 'gen_histogram_enum.py'
 enums.inputs = histogram_files
 
 # Generate scalar files.
 scalar_files = [
     'Scalars.yaml',
 ]
 
 scalar_data = GENERATED_FILES['TelemetryScalarData.h']
-scalar_data.script = 'gen-scalar-data.py'
+scalar_data.script = 'gen_scalar_data.py'
 scalar_data.inputs = scalar_files
 
 scalar_enums = GENERATED_FILES['TelemetryScalarEnums.h']
-scalar_enums.script = 'gen-scalar-enum.py'
+scalar_enums.script = 'gen_scalar_enum.py'
 scalar_enums.inputs = scalar_files
 
 # Generate event files.
 event_files = [
     'Events.yaml',
 ]
 
 event_data = GENERATED_FILES['TelemetryEventData.h']
-event_data.script = 'gen-event-data.py'
+event_data.script = 'gen_event_data.py'
 event_data.inputs = event_files
 
 event_enums = GENERATED_FILES['TelemetryEventEnums.h']
-event_enums.script = 'gen-event-enum.py'
+event_enums.script = 'gen_event_enum.py'
 event_enums.inputs = event_files
 
 # Generate data from Processes.yaml
 processes_files = [
     'Processes.yaml',
 ]
 
 processes_enum = GENERATED_FILES['TelemetryProcessEnums.h']
-processes_enum.script = 'gen-process-enum.py'
+processes_enum.script = 'gen_process_enum.py'
 processes_enum.inputs = processes_files
 
 processes_data = GENERATED_FILES['TelemetryProcessData.h']
-processes_data.script = 'gen-process-data.py'
+processes_data.script = 'gen_process_data.py'
 processes_data.inputs = processes_files
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Telemetry')