diff options
author | Martin Peres <martin.peres@linux.intel.com> | 2015-07-27 17:23:23 +0300 |
---|---|---|
committer | Martin Peres <martin.peres@linux.intel.com> | 2015-07-27 17:37:52 +0300 |
commit | 127fd9e422a97f6d3f957b6b9d22166363b0a5c7 (patch) | |
tree | da611a0fe23a4e6fad70b617c6acefaf3a06b148 /stats | |
parent | 735cb554a3eb6f44fbbf8019c806526729e19f73 (diff) |
stats/gen_report: support the case were not all commits have a benchmark
Diffstat (limited to 'stats')
-rwxr-xr-x | stats/gen_report.py | 59 |
1 files changed, 35 insertions, 24 deletions
diff --git a/stats/gen_report.py b/stats/gen_report.py index faf0857..094beaa 100755 --- a/stats/gen_report.py +++ b/stats/gen_report.py @@ -324,6 +324,8 @@ table_entry_template=""" <a/> </td>""" +table_entry_no_results_template="""<td bgcolor="#FFFF00"><center>NO DATA</center>""" + commit_template=""" <h3 id="commit_{sha1}">{commit}</h3> Here is the <a href="{compile_log}">compilation logs</a> and list of benchmarks found for commit {sha1}: @@ -343,35 +345,44 @@ tbl_entries_txt = "" for commit in commits: benchs_txt = "" tbl_res_benchmarks = "" - for result in commit.results: - value = array(result.data).mean() + for benchmark in benchmarks: + result = None + for r in commit.results: + if r.benchmark == benchmark: + result = r + break + + if result != None: + value = array(result.data).mean() - if result.benchmark.prevValue > 0: - diff = (value * 100.0 / result.benchmark.prevValue) - 100.0 - else: - diff = 0 - result.benchmark.prevValue = value + if result.benchmark.prevValue > 0: + diff = (value * 100.0 / result.benchmark.prevValue) - 100.0 + else: + diff = 0 + result.benchmark.prevValue = value - if diff < -1.5: - color = "#FF0000" - elif diff > 1.5: - color = "#00FF00" - else: - color = "#FFFFFF" + if diff < -1.5: + color = "#FF0000" + elif diff > 1.5: + color = "#00FF00" + else: + color = "#FFFFFF" - # Generate the html - benchs_txt += bench_template.format(sha1=commit.sha1, - bench_name=result.benchmark.full_name, - img_src=result.img_src_name, - raw_data_file=result.data_raw_file) + # Generate the html + benchs_txt += bench_template.format(sha1=commit.sha1, + bench_name=result.benchmark.full_name, + img_src=result.img_src_name, + raw_data_file=result.data_raw_file) - tbl_res_benchmarks += table_entry_template.format(sha1=commit.sha1, - bench_name=result.benchmark.full_name, - sparkline_img=result.sparkline_img, - value=value, - diff=diff, - color=color) + tbl_res_benchmarks += table_entry_template.format(sha1=commit.sha1, + bench_name=result.benchmark.full_name, + sparkline_img=result.sparkline_img, + value=value, + diff=diff, + color=color) + else: + tbl_res_benchmarks += table_entry_no_results_template # generate the html tbl_entries_txt += table_commit_template.format(sha1=commit.sha1, geom_mean=0, |