From: stevenknight Date: Fri, 18 Dec 2009 06:58:37 +0000 (+0000) Subject: Trace the system load average (Linux-only code) before starting the X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8f48fc08a0890cc4673bf888314fd30fa51b2597;p=scons.git Trace the system load average (Linux-only code) before starting the help / full / null builds in a timing run. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4561 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index c98314bf..ad773a06 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -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: