diff options
author | Steven Knight <knight@baldmt.com> | 2009-12-18 06:58:37 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2009-12-18 06:58:37 (GMT) |
commit | a158bdde183073bb22007d08b4a7cfa1163f082a (patch) | |
tree | 8f5adc0778d0b78323a4017beda2d82641bf62bd | |
parent | 7218499a0d11b1a47d0b2c5f6801e2d430678bb2 (diff) | |
download | SCons-a158bdde183073bb22007d08b4a7cfa1163f082a.zip SCons-a158bdde183073bb22007d08b4a7cfa1163f082a.tar.gz SCons-a158bdde183073bb22007d08b4a7cfa1163f082a.tar.bz2 |
Trace the system load average (Linux-only code) before starting the
help / full / null builds in a timing run.
-rw-r--r-- | QMTest/TestSCons.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index c98314b..ad773a0 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: |