From 3b25404f0f99b72f222bdca815929be1cf1cee35 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Fri, 31 Mar 2017 17:07:29 +0300 Subject: 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] Signed-off-by: Markus Lehtonen Signed-off-by: Richard Purdie --- scripts/lib/build_perf/html/measurement_chart.html | 50 +++++ scripts/lib/build_perf/html/report.html | 209 +++++++++++++++++++++ 2 files changed, 259 insertions(+) create mode 100644 scripts/lib/build_perf/html/measurement_chart.html create mode 100644 scripts/lib/build_perf/html/report.html (limited to 'scripts/lib/build_perf/html') 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 @@ + + diff --git a/scripts/lib/build_perf/html/report.html b/scripts/lib/build_perf/html/report.html new file mode 100644 index 0000000000..e42871177d --- /dev/null +++ b/scripts/lib/build_perf/html/report.html @@ -0,0 +1,209 @@ + + + +{# Scripts, for visualization#} + + + + +{# 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 %} +{% endfor %} + + + +{# Styles #} + + +{{ title }} + + +{% macro poky_link(commit) -%} + {{ commit[0:11] }} +{%- endmacro %} + +
+ {# Test metadata #} +

General

+
+ + + + + + + {% for key, item in metadata.items() %} + + + {%if key == 'commit' %} + + + {% else %} + + + {% endif %} + + {% endfor %} +
Current commitComparing with
{{ item.title }}{{ poky_link(item.value) }}{{ poky_link(item.value_old) }}{{ item.value }}{{ item.value_old }}
+ + {# Test result summary #} +

Test result summary

+
+ + {% for test in test_data %} + {% if loop.index is even %} + {% set row_style = 'style="background-color: #f2f2f2"' %} + {% else %} + {% set row_style = 'style="background-color: #ffffff"' %} + {% endif %} + + {% if test.status == 'SUCCESS' %} + {% for measurement in test.measurements %} + {# add empty cell in place of the test name#} + {% if loop.index > 1 %}{% endif %} + {% if measurement.absdiff > 0 %} + {% set result_style = "color: red" %} + {% elif measurement.absdiff == measurement.absdiff %} + {% set result_style = "color: green" %} + {% else %} + {% set result_style = "color: orange" %} + {%endif %} + + + + + + {% endfor %} + {% else %} + + + {% endif %} + + {% endfor %} +
{{ test.name }}: {{ test.description }}{{ measurement.description }}{{ measurement.value.mean }}{{ measurement.absdiff_str }}{{ measurement.reldiff }}
{{test.status }}
+ + {# Detailed test results #} + {% for test in test_data %} +

{{ test.name }}: {{ test.description }}

+
+ {% if test.status == 'SUCCESS' %} + {% for measurement in test.measurements %} +
+

{{ measurement.description }}

+
+ {{ measurement.value.mean }} + + {% if measurement.absdiff > 0 %} + + {% elif measurement.absdiff == measurement.absdiff %} + + {% else %} + + {% endif %} + {{ measurement.absdiff_str }} ({{measurement.reldiff}}) + +
+ + + + + +
+ {# Linechart #} +
+
+ {# Measurement statistics #} + + + + + + + + + + + + + + +
Test runs{{ measurement.value.sample_cnt }}
-/+-{{ measurement.value.minus }} / +{{ measurement.value.plus }}
Min{{ measurement.value.min }}
Max{{ measurement.value.max }}
Stdev{{ measurement.value.stdev }}
+
+
+ {% endfor %} + {# Unsuccessful test #} + {% else %} + {{ test.status }} + {% if test.err_type %}({{ test.err_type }}){% endif %} + +
{{ test.message }}
+ {% endif %} + {% endfor %} +
+ + -- cgit v1.2.3