summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorJ. Randall Hunt <randallhunt@gmail.com>2012-12-11 13:43:28 -0500
committerJ. Randall Hunt <randallhunt@gmail.com>2012-12-11 14:56:11 -0500
commit7f15a5ca4f8766e935cc7881fec2edb6b939ccec (patch)
tree8b9e3ddc791d38c84420e39d121f92fb8e01d860 /buildscripts
parentd53150750557b974d859da3c56dc0ae847e67cc2 (diff)
downloadmongo-7f15a5ca4f8766e935cc7881fec2edb6b939ccec.tar.gz
[BUILDBOT-138] Fix test elapsed time units to be more sane
Will display milliseconds if time is less than 10 seconds, seconds if less than 60 seconds, minutes if more than 60 seconds
Diffstat (limited to 'buildscripts')
-rwxr-xr-xbuildscripts/smoke.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/buildscripts/smoke.py b/buildscripts/smoke.py
index 1433777b764..9210a713631 100755
--- a/buildscripts/smoke.py
+++ b/buildscripts/smoke.py
@@ -460,7 +460,19 @@ def runTest(test):
t2 = time.time()
del os.environ['MONGO_TEST_FILENAME']
- sys.stdout.write(" %fms\n" % ((t2 - t1) * 1000))
+ timediff = t2 - t1
+ # timediff is seconds by default
+ scale = 1
+ suffix = "seconds"
+ # if timediff is less than 10 seconds use ms
+ if timediff < 10:
+ scale = 1000
+ suffix = "ms"
+ # if timediff is more than 60 seconds use minutes
+ elif timediff > 60:
+ scale = 1.0 / 60.0
+ suffix = "minutes"
+ sys.stdout.write(" %10.4f %s\n" % ((timediff) * scale, suffix))
sys.stdout.flush()
if r != 0: