Bug 1244143 - Record whether or not an artifact build was used in build telemetry data r?gps
This adds a substs field and cherrypicks the MOZ_ARTIFACT_BUILDS field so
we can determine whether or not an artifact build occurred.
MozReview-Commit-ID: 8aio8mP8pmR
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -490,18 +490,31 @@ class Build(MachCommandBase):
# if excessive:
# print(EXCESSIVE_SWAP_MESSAGE)
print('To view resource usage of the build, run |mach '
'resource-usage|.')
telemetry_handler = getattr(self._mach_context,
'telemetry_handler', None)
- usage = monitor.record_resource_usage()
- telemetry_handler(self._mach_context, usage)
+ telemetry_data = monitor.record_resource_usage()
+
+ # Record build configuration data. For now, we cherry pick
+ # items we need rather than grabbing everything, in order
+ # to avoid accidentally disclosing PII.
+ try:
+ moz_artifact_builds = self.substs.get('MOZ_ARTIFACT_BUILDS',
+ False)
+ telemetry_data['substs'] = {
+ 'MOZ_ARTIFACT_BUILDS': moz_artifact_builds,
+ }
+ except BuildEnvironmentNotFoundException:
+ pass
+
+ telemetry_handler(self._mach_context, telemetry_data)
# Only for full builds because incremental builders likely don't
# need to be burdened with this.
if not what:
try:
# Fennec doesn't have useful output from just building. We should
# arguably make the build action useful for Fennec. Another day...
if self.substs['MOZ_BUILD_APP'] != 'mobile/android':