Trace the system load average (Linux-only code) before starting the
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 18 Dec 2009 06:58:37 +0000 (06:58 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 18 Dec 2009 06:58:37 +0000 (06:58 +0000)
help / full / null builds in a timing run.

git-svn-id: http://scons.tigris.org/svn/scons/trunk@4561 fdb21ef1-2011-0410-befe-b5e4ea1792b1

QMTest/TestSCons.py

index c98314bf0275b44bd0c5277a7735f83c51f00c52..ad773a06e119e8b90bf1c54f25761cd3e9fb316d 100644 (file)
@@ -1080,6 +1080,7 @@ class TimeSCons(TestSCons):
             #self.calibration(*args, **kw)
             apply(self.calibration, args, kw)
         else:
+            self.uptime()
             # TODO(1.5)
             #self.help(*args, **kw)
             #self.full(*args, **kw)
@@ -1108,6 +1109,18 @@ class TimeSCons(TestSCons):
             #self.trace(name, trace, *args)
             apply(self.trace, (name, trace), args)
 
+    def uptime(self):
+        try:
+            fp = open('/proc/loadavg')
+        except EnvironmentError:
+            pass
+        else:
+            avg1, avg5, avg15 = fp.readline().split(" ")[:3]
+            fp.close()
+            self.trace('load-average',  'average1', avg1, 'processes')
+            self.trace('load-average',  'average5', avg5, 'processes')
+            self.trace('load-average',  'average15', avg15, 'processes')
+
     def collect_stats(self, input):
         result = {}
         for stat in StatList: