diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2017-04-03 18:58:34 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-05 12:36:45 +0100 |
commit | 79b90ae02257002ea831a48f6798794b7711c1f8 (patch) | |
tree | 6da6da99faf00ffe3a0d2fc7806d46839c4d1274 /scripts | |
parent | f84d0bd7deb4c19fdb1e821b3a50e8c8f54a731b (diff) | |
download | openembedded-core-79b90ae02257002ea831a48f6798794b7711c1f8.tar.gz openembedded-core-79b90ae02257002ea831a48f6798794b7711c1f8.tar.bz2 openembedded-core-79b90ae02257002ea831a48f6798794b7711c1f8.zip |
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.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/build_perf/html/measurement_chart.html | 6 | ||||
-rw-r--r-- | scripts/lib/build_perf/html/report.html | 5 |
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 @@ <script type="text/javascript"> + chartsDrawing += 1; google.charts.setOnLoadCallback(drawChart_{{ chart_elem_id }}); function drawChart_{{ chart_elem_id }}() { var data = new google.visualization.DataTable(); @@ -39,10 +40,9 @@ png_div = document.getElementById('{{ chart_elem_id }}_png'); png_div.outerHTML = '<a id="{{ chart_elem_id }}_png" href="' + chart.getImageURI() + '">PNG</a>'; console.log("CHART READY: {{ chart_elem_id }}"); - {% if last_chart == true %} + chartsDrawing -= 1; + if (chartsDrawing == 0) console.log("ALL CHARTS READY"); - {% endif %} - //console.log(chart_div.innerHTML); }); chart.draw(data, options); } 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 @@ <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('current', {'packages':['corechart']}); +var chartsDrawing = 0; </script> {# Render measurement result charts #} {% for test in test_data %} - {% set test_loop = loop %} {% if test.status == 'SUCCESS' %} {% for measurement in test.measurements %} {% set chart_elem_id = test.name + '_' + measurement.name + '_chart' %} - {% if test_loop.last and loop.last %} - {% set last_chart = true %} - {% endif %} {% include 'measurement_chart.html' %} {% endfor %} {% endif %} |