summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-04-03 18:58:34 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-05 23:22:13 +0100
commitdf202600168adeccd5f4713bb1dfb6c09d65a2f0 (patch)
treebf46ec6a1d3c84dd5355da075a75114bc2d09aea
parent728c668473b11faba90465efe2e960463a1f0bb8 (diff)
downloadpoky-df202600168adeccd5f4713bb1dfb6c09d65a2f0.tar.gz
scripts/oe-build-perf-report: fix 'charts ready' console message
The javascript console log messages are used in scraping, when converting an html test report to html email. Before this patch a console message indicating that all charts have been drawn was not correctly sent if the last test failed (or didn't have chart data for some other reason) which, in turn, caused oe-build-perf-report-email.py script to fail with a timeout. (From OE-Core rev: 79b90ae02257002ea831a48f6798794b7711c1f8) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/build_perf/html/measurement_chart.html6
-rw-r--r--scripts/lib/build_perf/html/report.html5
2 files changed, 4 insertions, 7 deletions
diff --git a/scripts/lib/build_perf/html/measurement_chart.html b/scripts/lib/build_perf/html/measurement_chart.html
index 26fe1453c0..65f1a227ad 100644
--- a/scripts/lib/build_perf/html/measurement_chart.html
+++ b/scripts/lib/build_perf/html/measurement_chart.html
@@ -1,4 +1,5 @@
1<script type="text/javascript"> 1<script type="text/javascript">
2 chartsDrawing += 1;
2 google.charts.setOnLoadCallback(drawChart_{{ chart_elem_id }}); 3 google.charts.setOnLoadCallback(drawChart_{{ chart_elem_id }});
3 function drawChart_{{ chart_elem_id }}() { 4 function drawChart_{{ chart_elem_id }}() {
4 var data = new google.visualization.DataTable(); 5 var data = new google.visualization.DataTable();
@@ -39,10 +40,9 @@
39 png_div = document.getElementById('{{ chart_elem_id }}_png'); 40 png_div = document.getElementById('{{ chart_elem_id }}_png');
40 png_div.outerHTML = '<a id="{{ chart_elem_id }}_png" href="' + chart.getImageURI() + '">PNG</a>'; 41 png_div.outerHTML = '<a id="{{ chart_elem_id }}_png" href="' + chart.getImageURI() + '">PNG</a>';
41 console.log("CHART READY: {{ chart_elem_id }}"); 42 console.log("CHART READY: {{ chart_elem_id }}");
42 {% if last_chart == true %} 43 chartsDrawing -= 1;
44 if (chartsDrawing == 0)
43 console.log("ALL CHARTS READY"); 45 console.log("ALL CHARTS READY");
44 {% endif %}
45 //console.log(chart_div.innerHTML);
46 }); 46 });
47 chart.draw(data, options); 47 chart.draw(data, options);
48} 48}
diff --git a/scripts/lib/build_perf/html/report.html b/scripts/lib/build_perf/html/report.html
index e42871177d..165cbb811c 100644
--- a/scripts/lib/build_perf/html/report.html
+++ b/scripts/lib/build_perf/html/report.html
@@ -6,17 +6,14 @@
6<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> 6<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
7<script type="text/javascript"> 7<script type="text/javascript">
8google.charts.load('current', {'packages':['corechart']}); 8google.charts.load('current', {'packages':['corechart']});
9var chartsDrawing = 0;
9</script> 10</script>
10 11
11{# Render measurement result charts #} 12{# Render measurement result charts #}
12{% for test in test_data %} 13{% for test in test_data %}
13 {% set test_loop = loop %}
14 {% if test.status == 'SUCCESS' %} 14 {% if test.status == 'SUCCESS' %}
15 {% for measurement in test.measurements %} 15 {% for measurement in test.measurements %}
16 {% set chart_elem_id = test.name + '_' + measurement.name + '_chart' %} 16 {% set chart_elem_id = test.name + '_' + measurement.name + '_chart' %}
17 {% if test_loop.last and loop.last %}
18 {% set last_chart = true %}
19 {% endif %}
20 {% include 'measurement_chart.html' %} 17 {% include 'measurement_chart.html' %}
21 {% endfor %} 18 {% endfor %}
22 {% endif %} 19 {% endif %}