Commit 4b30c707 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

benchmark-releases.py: bikeshed output

parent 521317d5
...@@ -142,9 +142,7 @@ def go(cmd, log=None, time=False): ...@@ -142,9 +142,7 @@ def go(cmd, log=None, time=False):
flog.close() flog.close()
if returncode: if returncode:
print('FAILED', end=' ') print(color(ANSI.RED, "FAILED"))
if not time:
print()
sys.stdout.flush() sys.stdout.flush()
raise subprocess.CalledProcessError(returncode, cmd) raise subprocess.CalledProcessError(returncode, cmd)
elif not time: elif not time:
...@@ -185,7 +183,7 @@ def get_releases(): ...@@ -185,7 +183,7 @@ def get_releases():
def install(release, tgz): def install(release, tgz):
os.system('mkdir -p %s' % BIN) os.system('mkdir -p %s' % BIN)
os.system('mkdir -p %s' % GERM) os.system('mkdir -p %s' % GERM)
print('== %s' % release) print('==', color(ANSI.MAGENTA, release))
dir = SRC + release dir = SRC + release
go('mkdir -p %s' % dir) go('mkdir -p %s' % dir)
...@@ -217,7 +215,7 @@ def install_from_archive(install_versions): ...@@ -217,7 +215,7 @@ def install_from_archive(install_versions):
if (not install_versions) or release in install_versions: if (not install_versions) or release in install_versions:
install(release, tgz) install(release, tgz)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
print("FAILED") print(color(ANSI.RED, "Install failed "))
def installed(): def installed():
return sorted([f.replace(BIN, '') for f in glob.glob('%s/*' % BIN)]) return sorted([f.replace(BIN, '') for f in glob.glob('%s/*' % BIN)])
...@@ -230,11 +228,13 @@ def run_all(tag, args, retries): ...@@ -230,11 +228,13 @@ def run_all(tag, args, retries):
print(color(ANSI.MAGENTA, '%9s' % release), end=' ') print(color(ANSI.MAGENTA, '%9s' % release), end=' ')
log = RUN + '/%s-%s.log' % (tag, release) log = RUN + '/%s-%s.log' % (tag, release)
cmd = '%s/%s ' % (BIN, release) + convert(args, release) cmd = '%s/%-9s ' % (BIN, release) + convert(args, release)
cmd = cmd.replace(GERM_VAR, '%s/%s' % (GERM, release)) cmd = cmd.replace(GERM_VAR, '%s/%s' % (GERM, release))
try: try:
benchs = [] benchs = []
for i in range(retries) : for i in range(retries) :
if i:
print('%9s' % '', end=' ')
benchs.append(go(cmd, log, True)) benchs.append(go(cmd, log, True))
time = min([b[0] for b in benchs]) time = min([b[0] for b in benchs])
mem = min([b[1] for b in benchs]) mem = min([b[1] for b in benchs])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment