From cf8aeba48be1442381997716313837fcdd185f71 Mon Sep 17 00:00:00 2001 From: Martin Peres Date: Wed, 2 Sep 2015 10:44:28 +0300 Subject: stats/gen_report: better handle reports with holes in their data --- stats/gen_report.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'stats') diff --git a/stats/gen_report.py b/stats/gen_report.py index 5b88024..9dadae9 100755 --- a/stats/gen_report.py +++ b/stats/gen_report.py @@ -195,14 +195,18 @@ html_template=""" ['${commit.label}', % for benchmark in benchmarks: <% - result = None - for res in commit.results: - if res.benchmark == benchmark: - result = res - sparkline_img = report_folder + result.data_raw_file + ".spark.svg" - break + result = None + for res in commit.results: + if res.benchmark == benchmark: + result = res + sparkline_img = report_folder + result.data_raw_file + ".spark.svg" + break %> - ${result.diff_absolute}, "

${commit.label} - ${benchmark.full_name}

Commit SHA1: ${commit.sha1}

Value: ${result.diff_absolute} % (Diff with prev.: ${result.diff} %)

Raw data point: ${result.value} ${result.unit_str}

Sparkline of the performance
View more data

", + % if result != None: + ${result.diff_absolute}, "

${commit.label} - ${benchmark.full_name}

Commit SHA1: ${commit.sha1}

Value: ${result.diff_absolute} % (Diff with prev.: ${result.diff} %)

Raw data point: ${result.value} ${result.unit_str}

Sparkline of the performance
View more data

", + % else: + null, "

${commit.label} - ${benchmark.full_name}

Commit SHA1: ${commit.sha1}

NO DATA

", + % endif % endfor ], % endfor @@ -307,7 +311,7 @@ html_template=""" sparkline_img = report_folder + result.data_raw_file + ".spark.svg" break %> - % if result.value != None: + % if result != None and result.value != None: ${result.value} (${result.diff} %) @@ -364,7 +368,7 @@ html_template=""" sparkline_img = report_folder + result.data_raw_file + ".spark.svg" break %> - % if result.value != None: + % if result != None and result.value != None:

${benchmark.full_name} (commit ${commit.full_name})

Original data

-- cgit v1.2.3