Bug 1239296 - Use telemetry_handler to store build resource data r?gps draft
authorDan Minor <dminor@mozilla.com>
Fri, 29 Jan 2016 12:53:00 -0500
changeset 329830 19c3ef89f4eb704f6cf8cf0da75bb9c4c3061199
parent 329829 3722b49cc42c969636cf5f557445a68dc8b566df
child 329831 38793cfe0c9a5add554c4dfbf81dc4dfb3362ec0
push id10616
push userdminor@mozilla.com
push dateTue, 09 Feb 2016 16:18:53 +0000
reviewersgps
bugs1239296
milestone47.0a1
Bug 1239296 - Use telemetry_handler to store build resource data r?gps
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -488,16 +488,21 @@ class Build(MachCommandBase):
         if monitor.have_resource_usage:
             excessive, swap_in, swap_out = monitor.have_excessive_swapping()
             # 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)
+
         # 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':
                     print('To take your build for a test drive, run: |mach run|')