From 8f48fc08a0890cc4673bf888314fd30fa51b2597 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Fri, 18 Dec 2009 06:58:37 +0000 Subject: [PATCH] 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 --- QMTest/TestSCons.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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: -- 2.26.2