All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/7] scripts/oe-build-perf-report: fix 'charts ready' console message
Date: Mon,  3 Apr 2017 18:58:34 +0300	[thread overview]
Message-ID: <20170403155839.14067-3-markus.lehtonen@linux.intel.com> (raw)
In-Reply-To: <20170403155839.14067-1-markus.lehtonen@linux.intel.com>

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>
---
 scripts/lib/build_perf/html/measurement_chart.html | 6 +++---
 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 26fe145..65f1a22 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 e428711..165cbb8 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 %}
-- 
2.10.2



  parent reply	other threads:[~2017-04-03 15:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 15:58 [PATCH 0/7] Build perf test enhancements Markus Lehtonen
2017-04-03 15:58 ` [PATCH 1/7] scripts/oe-build-perf-report: better guessing of args Markus Lehtonen
2017-04-03 15:58 ` Markus Lehtonen [this message]
2017-04-03 15:58 ` [PATCH 3/7] scripts/oe-build-perf-report: fix typo Markus Lehtonen
2017-04-03 15:58 ` [PATCH 4/7] build-perf-test-wrapper.sh: make it possible to specify Git branch name Markus Lehtonen
2017-04-03 15:58 ` [PATCH 5/7] build-perf-test-wrapper.sh: correctly check test script exit status Markus Lehtonen
2017-04-03 15:58 ` [PATCH 6/7] build-perf-test-wrapper.sh: support pushing to remote Git Markus Lehtonen
2017-04-03 15:58 ` [PATCH 7/7] build-perf-test-wrapper.sh: support sending email reports Markus Lehtonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170403155839.14067-3-markus.lehtonen@linux.intel.com \
    --to=markus.lehtonen@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.