Skip to content

Commit cbd8821

Browse files
committed
[benchmark] Added Benchmark Check Report
Produce Markdown formatted report, analyzing the quality of newly added benchmarks.
1 parent 92cf40d commit cbd8821

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

benchmark/scripts/run_smoke_bench

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ def test_opt_levels(args):
119119
args.platform, output_file):
120120
changes = True
121121

122+
check_added(args, output_file)
123+
122124
if output_file:
123125
if changes:
124126
output_file.write(get_info_text())
@@ -338,7 +340,7 @@ class DriverArgs(object):
338340
self.optimization = 'O'
339341

340342

341-
def check_added(args):
343+
def check_added(args, output_file=None):
342344
from imp import load_source
343345
# import Benchmark_Driver # doesn't work because it misses '.py' extension
344346
Benchmark_Driver = load_source(
@@ -347,12 +349,15 @@ def check_added(args):
347349
# from Benchmark_Driver import BenchmarkDriver, BenchmarkDoctor
348350
BenchmarkDriver = Benchmark_Driver.BenchmarkDriver
349351
BenchmarkDoctor = Benchmark_Driver.BenchmarkDoctor
352+
MarkdownReportHandler = Benchmark_Driver.MarkdownReportHandler
350353

351354
old = BenchmarkDriver(DriverArgs(args.oldbuilddir[0]))
352355
new = BenchmarkDriver(DriverArgs(args.newbuilddir[0]))
353356
added = set(new.tests).difference(set(old.tests))
354357
new.tests = list(added)
355358
doctor = BenchmarkDoctor(args, driver=new)
359+
if output_file:
360+
doctor.log.addHandler(MarkdownReportHandler(output_file))
356361
doctor.check()
357362

358363

0 commit comments

Comments
 (0)