summaryrefslogtreecommitdiffstats
path: root/scripts/lib/build_perf/html/measurement_chart.html
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-03-31 17:07:29 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-01 23:28:20 +0100
commit9f299876f716f253b0a3d70eb4473a023c593fc5 (patch)
tree057d934e96df36ac3e28113b11f5b1ce70c7b614 /scripts/lib/build_perf/html/measurement_chart.html
parent5a85d39c9d5502aabc2dde20f2a16bf7ac9f2d22 (diff)
downloadpoky-9f299876f716f253b0a3d70eb4473a023c593fc5.tar.gz
scripts: add oe-build-perf-report script
A new tool for pretty-printing build perf test results stored in a Git repository. The scripts is able to produce either simple plaintext report showing the difference between two commits, or, an html report that also displays trendcharts of the test results. The script uses Jinja2 templates for generating HTML reports so it requires python3-jinja2 to be installed on the system. [YOCTO #10931] (From OE-Core rev: 3b25404f0f99b72f222bdca815929be1cf1cee35) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/build_perf/html/measurement_chart.html')
-rw-r--r--scripts/lib/build_perf/html/measurement_chart.html50
1 files changed, 50 insertions, 0 deletions
diff --git a/scripts/lib/build_perf/html/measurement_chart.html b/scripts/lib/build_perf/html/measurement_chart.html
new file mode 100644
index 0000000000..26fe1453c0
--- /dev/null
+++ b/scripts/lib/build_perf/html/measurement_chart.html
@@ -0,0 +1,50 @@
1<script type="text/javascript">
2 google.charts.setOnLoadCallback(drawChart_{{ chart_elem_id }});
3 function drawChart_{{ chart_elem_id }}() {
4 var data = new google.visualization.DataTable();
5
6 // Chart options
7 var options = {
8 theme : 'material',
9 legend: 'none',
10 hAxis: { format: '', title: 'Commit number',
11 minValue: {{ chart_opts.haxis.min }},
12 maxValue: {{ chart_opts.haxis.max }} },
13 {% if measurement.type == 'time' %}
14 vAxis: { format: 'h:mm:ss' },
15 {% else %}
16 vAxis: { format: '' },
17 {% endif %}
18 pointSize: 5,
19 chartArea: { left: 80, right: 15 },
20 };
21
22 // Define data columns
23 data.addColumn('number', 'Commit');
24 data.addColumn('{{ measurement.value_type.gv_data_type }}',
25 '{{ measurement.value_type.quantity }}');
26 // Add data rows
27 data.addRows([
28 {% for sample in measurement.samples %}
29 [{{ sample.commit_num }}, {{ sample.mean.gv_value() }}],
30 {% endfor %}
31 ]);
32
33 // Finally, draw the chart
34 chart_div = document.getElementById('{{ chart_elem_id }}');
35 var chart = new google.visualization.LineChart(chart_div);
36 google.visualization.events.addListener(chart, 'ready', function () {
37 //chart_div = document.getElementById('{{ chart_elem_id }}');
38 //chart_div.innerHTML = '<img src="' + chart.getImageURI() + '">';
39 png_div = document.getElementById('{{ chart_elem_id }}_png');
40 png_div.outerHTML = '<a id="{{ chart_elem_id }}_png" href="' + chart.getImageURI() + '">PNG</a>';
41 console.log("CHART READY: {{ chart_elem_id }}");
42 {% if last_chart == true %}
43 console.log("ALL CHARTS READY");
44 {% endif %}
45 //console.log(chart_div.innerHTML);
46 });
47 chart.draw(data, options);
48}
49</script>
50