Bug 867033 - Check self.wall_time for being zero. r=gps
authorEdmund Wong <ewong@pw-wspx.org>
Thu, 02 May 2013 13:05:53 +0800
changeset 141491 7f72b029e78e88e5c6a7557626fadb604137b63c
parent 141490 0274ab3783b154931a0f975d4ca9fdbf292163ae
child 141494 70e0955ccc87a145deb366eaade6c5f7d926da1f
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs867033
milestone23.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 867033 - Check self.wall_time for being zero. r=gps
python/mozbuild/mozbuild/backend/base.py
--- a/python/mozbuild/mozbuild/backend/base.py
+++ b/python/mozbuild/mozbuild/backend/base.py
@@ -66,18 +66,19 @@ class BackendConsumeSummary(object):
         return 'Backend executed in {:.2f}s'.format(self.backend_execution_time)
 
     def backend_detailed_summary(self):
         """Backend summary to be supplied by BuildBackend implementations."""
         return None
 
     @property
     def total_summary(self):
+        efficiency_value = self.cpu_time / self.wall_time if self.wall_time else 100
         return 'Total wall time: {:.2f}s; CPU time: {:.2f}s; Efficiency: {:.0%}'.format(
-            self.wall_time, self.cpu_time, self.cpu_time / self.wall_time)
+            self.wall_time, self.cpu_time, efficiency_value)
 
     def summaries(self):
         yield self.reader_summary
         yield self.backend_summary
 
         detailed = self.backend_detailed_summary()
         if detailed:
             yield detailed