PSA: Telemetry scalars can be added in artifact/build faster builds

Alessio Placitelli aplacitelli at mozilla.com
Fri Feb 9 09:36:54 UTC 2018


*tl;dr* - yes, *no need* to perform a full rebuild when adding a new Scalar
<https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/telemetry/collection/scalars.html>
\o/

*What's the problem?*
Adding a new scalar internally generates an header file which is included
by many modules throughout the codebase. This required developers to
rebuild *all* these C++ modules in order to use the newly added probes,
even when using artifact/build faster build workflows.


*Who benefits from this?*
Any developer using artifact builds
<https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Artifact_builds>
or building with *./mach build faster* that needs to add a new scalar probe
(*/me winks at fx-team*).

*What do I need to do?*
This is even better: *nothing*, *null, nada, nihil*. It *just works*, in *local
developer builds* for new scalar definitions (not for changing existing
scalars).
Just follow the usual procedure
<https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/telemetry/collection/scalars.html#adding-a-new-probe>
to add a new scalar. Of course the probes will still be available for all
build configurations when performing a full build.

*How does it work? Is there any downside?*
When a new scalar is added, along with a new header file, the build system
generates a JSON file containing the scalar definitions. These definitions
are saved in the same directory as the Firefox executable and loaded at
startup by builds not defining MOZILLA_OFFICIAL
<https://searchfox.org/mozilla-central/rev/a5abf843f8fac8530aa5de6fb40e16547bb4a47a/toolkit/components/telemetry/TelemetryController.jsm#1061-1064>
.

As discussed in bug 1425909
<https://bugzilla.mozilla.org/show_bug.cgi?id=1425909>, there might be
small perf implications due to loading the scalar list at startup for
developer builds.

*Reaching out*

   -     If you have any questions reach out to :gfritzsche, :chutten,
   :dexter or the team <https://wiki.mozilla.org/Telemetry#Communication>.
   -     For any specific issues, please file a bug
   <https://bugzilla.mozilla.org/enter_bug.cgi?product=Toolkit&component=Telemetry&blocked=1425909>
   and make it block bug 1425909.

*With <3*, by the Telemetry client people.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/firefox-dev/attachments/20180209/b98177cc/attachment-0001.html>


More information about the firefox-dev mailing list