Skip to content

Commit cb23837

Browse files
committed
[Compare Perf] Add support for markdown and html
1 parent defe364 commit cb23837

File tree

2 files changed

+369
-221
lines changed

2 files changed

+369
-221
lines changed

benchmark/scripts/Benchmark_Driver

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,13 @@ def format_name(log_path):
255255
return '/'.join(log_path.split('/')[-2:])
256256

257257

258-
def compare_logs(compare_script, new_log, old_log):
258+
def compare_logs(compare_script, new_log, old_log, log_dir, opt):
259259
"""Return diff of log files at paths `new_log` and `old_log`"""
260260
print('Comparing %s %s ...' % (format_name(old_log), format_name(new_log)))
261-
subprocess.call([compare_script, old_log, new_log])
261+
subprocess.call([compare_script, '--old-file', old_log,
262+
'--new-file', new_log, '--format', 'markdown',
263+
'--output', os.path.join(log_dir, 'latest_compare_{0}.md'
264+
.format(opt))])
262265

263266

264267
def compare(args):
@@ -288,10 +291,12 @@ def compare(args):
288291
len(recent_logs['master_Onone']) > 1:
289292
compare_logs(compare_script,
290293
recent_logs['master_O'][0],
291-
recent_logs['master_O'][1])
294+
recent_logs['master_O'][1],
295+
log_dir, 'O')
292296
compare_logs(compare_script,
293297
recent_logs['master_Onone'][0],
294-
recent_logs['master_Onone'][1])
298+
recent_logs['master_Onone'][1],
299+
log_dir, 'Onone')
295300
else:
296301
print('master/master comparison skipped: no previous master logs')
297302
else:
@@ -307,10 +312,12 @@ def compare(args):
307312
else:
308313
compare_logs(compare_script,
309314
recent_logs[current_branch + '_O'][0],
310-
recent_logs[current_branch + '_O'][1])
315+
recent_logs[current_branch + '_O'][1],
316+
log_dir, 'O')
311317
compare_logs(compare_script,
312318
recent_logs[current_branch + '_Onone'][0],
313-
recent_logs[current_branch + '_Onone'][1])
319+
recent_logs[current_branch + '_Onone'][1],
320+
log_dir, 'Onone')
314321

315322
if len(recent_logs['master_O']) == 0 or \
316323
len(recent_logs['master_Onone']) == 0:
@@ -319,10 +326,12 @@ def compare(args):
319326
else:
320327
compare_logs(compare_script,
321328
recent_logs[current_branch + '_O'][0],
322-
recent_logs['master_O'][0])
329+
recent_logs['master_O'][0],
330+
log_dir, 'O')
323331
compare_logs(compare_script,
324332
recent_logs[current_branch + '_Onone'][0],
325-
recent_logs['master_Onone'][0])
333+
recent_logs['master_Onone'][0],
334+
log_dir, 'Onone')
326335

327336
# TODO: Fail on large regressions
328337

0 commit comments

Comments
 (0)