summaryrefslogtreecommitdiffstats
path: root/scripts/lib/build_perf/html/report.html
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/build_perf/html/report.html')
-rw-r--r--scripts/lib/build_perf/html/report.html195
1 files changed, 157 insertions, 38 deletions
diff --git a/scripts/lib/build_perf/html/report.html b/scripts/lib/build_perf/html/report.html
index d1ba6f2578..28cd80e738 100644
--- a/scripts/lib/build_perf/html/report.html
+++ b/scripts/lib/build_perf/html/report.html
@@ -3,17 +3,14 @@
3<head> 3<head>
4{# Scripts, for visualization#} 4{# Scripts, for visualization#}
5<!--START-OF-SCRIPTS--> 5<!--START-OF-SCRIPTS-->
6<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> 6<script src=" https://cdn.jsdelivr.net/npm/echarts@5.5.0/dist/echarts.min.js "></script>
7<script type="text/javascript">
8google.charts.load('current', {'packages':['corechart']});
9var chartsDrawing = 0;
10</script>
11 7
12{# Render measurement result charts #} 8{# Render measurement result charts #}
13{% for test in test_data %} 9{% for test in test_data %}
14 {% if test.status == 'SUCCESS' %} 10 {% if test.status == 'SUCCESS' %}
15 {% for measurement in test.measurements %} 11 {% for measurement in test.measurements %}
16 {% set chart_elem_id = test.name + '_' + measurement.name + '_chart' %} 12 {% set chart_elem_start_time_id = test.name + '_' + measurement.name + '_chart_start_time' %}
13 {% set chart_elem_commit_count_id = test.name + '_' + measurement.name + '_chart_commit_count' %}
17 {% include 'measurement_chart.html' %} 14 {% include 'measurement_chart.html' %}
18 {% endfor %} 15 {% endfor %}
19 {% endif %} 16 {% endif %}
@@ -23,28 +20,29 @@ var chartsDrawing = 0;
23 20
24{# Styles #} 21{# Styles #}
25<style> 22<style>
23:root {
24 --text: #000;
25 --bg: #fff;
26 --h2heading: #707070;
27 --link: #0000EE;
28 --trtopborder: #9ca3af;
29 --trborder: #e5e7eb;
30 --chartborder: #f0f0f0;
31 }
26.meta-table { 32.meta-table {
27 font-size: 14px; 33 font-size: 14px;
28 text-align: left; 34 text-align: left;
29 border-collapse: collapse; 35 border-collapse: collapse;
30} 36}
31.meta-table tr:nth-child(even){background-color: #f2f2f2}
32meta-table th, .meta-table td {
33 padding: 4px;
34}
35.summary { 37.summary {
36 margin: 0;
37 font-size: 14px; 38 font-size: 14px;
38 text-align: left; 39 text-align: left;
39 border-collapse: collapse; 40 border-collapse: collapse;
40} 41}
41summary th, .meta-table td {
42 padding: 4px;
43}
44.measurement { 42.measurement {
45 padding: 8px 0px 8px 8px; 43 padding: 8px 0px 8px 8px;
46 border: 2px solid #f0f0f0; 44 border: 2px solid var(--chartborder);
47 margin-bottom: 10px; 45 margin: 1.5rem 0;
48} 46}
49.details { 47.details {
50 margin: 0; 48 margin: 0;
@@ -64,18 +62,97 @@ summary th, .meta-table td {
64 background-color: #f0f0f0; 62 background-color: #f0f0f0;
65 margin-left: 10px; 63 margin-left: 10px;
66} 64}
67hr { 65.card-container {
68 color: #f0f0f0; 66 border-bottom-width: 1px;
67 padding: 1.25rem 3rem;
68 box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
69 border-radius: 0.25rem;
70}
71body {
72 font-family: 'Helvetica', sans-serif;
73 margin: 3rem 8rem;
74 background-color: var(--bg);
75 color: var(--text);
76}
77h1 {
78 text-align: center;
69} 79}
70h2 { 80h2 {
71 font-size: 20px; 81 font-size: 1.5rem;
72 margin-bottom: 0px; 82 margin-bottom: 0px;
73 color: #707070; 83 color: var(--h2heading);
84 padding-top: 1.5rem;
74} 85}
75h3 { 86h3 {
76 font-size: 16px; 87 font-size: 1.3rem;
77 margin: 0px; 88 margin: 0px;
78 color: #707070; 89 color: var(--h2heading);
90 padding: 1.5rem 0;
91}
92h4 {
93 font-size: 14px;
94 font-weight: lighter;
95 line-height: 1.2rem;
96 margin: auto;
97 padding-top: 1rem;
98}
99table {
100 margin-top: 1.5rem;
101 line-height: 2rem;
102}
103tr {
104 border-bottom: 1px solid var(--trborder);
105}
106tr:first-child {
107 border-bottom: 1px solid var(--trtopborder);
108}
109tr:last-child {
110 border-bottom: none;
111}
112a {
113 text-decoration: none;
114 font-weight: bold;
115 color: var(--link);
116}
117a:hover {
118 color: #8080ff;
119}
120button {
121 background-color: #F3F4F6;
122 border: none;
123 outline: none;
124 cursor: pointer;
125 padding: 10px 12px;
126 transition: 0.3s;
127 border-radius: 8px;
128 color: #3A4353;
129}
130button:hover {
131 background-color: #d6d9e0;
132}
133.tab button.active {
134 background-color: #d6d9e0;
135}
136@media (prefers-color-scheme: dark) {
137 :root {
138 --text: #e9e8fa;
139 --bg: #0F0C28;
140 --h2heading: #B8B7CB;
141 --link: #87cefa;
142 --trtopborder: #394150;
143 --trborder: #212936;
144 --chartborder: #b1b0bf;
145 }
146 button {
147 background-color: #28303E;
148 color: #fff;
149 }
150 button:hover {
151 background-color: #545a69;
152 }
153 .tab button.active {
154 background-color: #545a69;
155 }
79} 156}
80</style> 157</style>
81 158
@@ -83,13 +160,14 @@ h3 {
83</head> 160</head>
84 161
85{% macro poky_link(commit) -%} 162{% macro poky_link(commit) -%}
86 <a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?id={{ commit }}">{{ commit[0:11] }}</a> 163 <a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?id={{ commit }}">{{ commit[0:11] }}</a>
87{%- endmacro %} 164{%- endmacro %}
88 165
89<body><div style="width: 700px"> 166<body><div>
167 <h1 style="text-align: center;">Performance Test Report</h1>
90 {# Test metadata #} 168 {# Test metadata #}
91 <h2>General</h2> 169 <h2>General</h2>
92 <hr> 170 <h4>The table provides an overview of the comparison between two selected commits from the same branch.</h4>
93 <table class="meta-table" style="width: 100%"> 171 <table class="meta-table" style="width: 100%">
94 <tr> 172 <tr>
95 <th></th> 173 <th></th>
@@ -112,19 +190,21 @@ h3 {
112 190
113 {# Test result summary #} 191 {# Test result summary #}
114 <h2>Test result summary</h2> 192 <h2>Test result summary</h2>
115 <hr> 193 <h4>The test summary presents a thorough breakdown of each test conducted on the branch, including details such as build time and disk space consumption. Additionally, it gives insights into the average time taken for test execution, along with absolute and relative values for a better understanding.</h4>
116 <table class="summary" style="width: 100%"> 194 <table class="summary" style="width: 100%">
195 <tr>
196 <th>Test name</th>
197 <th>Measurement description</th>
198 <th>Mean value</th>
199 <th>Absolute difference</th>
200 <th>Relative difference</th>
201 </tr>
117 {% for test in test_data %} 202 {% for test in test_data %}
118 {% if loop.index is even %}
119 {% set row_style = 'style="background-color: #f2f2f2"' %}
120 {% else %}
121 {% set row_style = 'style="background-color: #ffffff"' %}
122 {% endif %}
123 {% if test.status == 'SUCCESS' %} 203 {% if test.status == 'SUCCESS' %}
124 {% for measurement in test.measurements %} 204 {% for measurement in test.measurements %}
125 <tr {{ row_style }}> 205 <tr {{ row_style }}>
126 {% if loop.index == 1 %} 206 {% if loop.index == 1 %}
127 <td>{{ test.name }}: {{ test.description }}</td> 207 <td><a href=#{{test.name}}>{{ test.name }}: {{ test.description }}</a></td>
128 {% else %} 208 {% else %}
129 {# add empty cell in place of the test name#} 209 {# add empty cell in place of the test name#}
130 <td></td> 210 <td></td>
@@ -153,10 +233,12 @@ h3 {
153 </table> 233 </table>
154 234
155 {# Detailed test results #} 235 {# Detailed test results #}
236 <h2>Test details</h2>
237 <h4>The following section provides details of each test, accompanied by charts representing build time and disk usage over time or by commit number.</h4>
156 {% for test in test_data %} 238 {% for test in test_data %}
157 <h2>{{ test.name }}: {{ test.description }}</h2> 239 <h3 style="color: #000;" id={{test.name}}>{{ test.name }}: {{ test.description }}</h3>
158 <hr>
159 {% if test.status == 'SUCCESS' %} 240 {% if test.status == 'SUCCESS' %}
241 <div class="card-container">
160 {% for measurement in test.measurements %} 242 {% for measurement in test.measurements %}
161 <div class="measurement"> 243 <div class="measurement">
162 <h3>{{ measurement.description }}</h3> 244 <h3>{{ measurement.description }}</h3>
@@ -178,7 +260,18 @@ h3 {
178 <tr> 260 <tr>
179 <td style="width: 75%"> 261 <td style="width: 75%">
180 {# Linechart #} 262 {# Linechart #}
181 <div id="{{ test.name }}_{{ measurement.name }}_chart"></div> 263 <div class="tab {{ test.name }}_{{ measurement.name }}_tablinks">
264 <button class="tablinks active" onclick="openChart(event, '{{ test.name }}_{{ measurement.name }}_start_time', '{{ test.name }}_{{ measurement.name }}')">Chart with start time</button>
265 <button class="tablinks" onclick="openChart(event, '{{ test.name }}_{{ measurement.name }}_commit_count', '{{ test.name }}_{{ measurement.name }}')">Chart with commit count</button>
266 </div>
267 <div class="{{ test.name }}_{{ measurement.name }}_tabcontent">
268 <div id="{{ test.name }}_{{ measurement.name }}_start_time" class="tabcontent" style="display: block;">
269 <div id="{{ test.name }}_{{ measurement.name }}_chart_start_time"></div>
270 </div>
271 <div id="{{ test.name }}_{{ measurement.name }}_commit_count" class="tabcontent" style="display: none;">
272 <div id="{{ test.name }}_{{ measurement.name }}_chart_commit_count"></div>
273 </div>
274 </div>
182 </td> 275 </td>
183 <td> 276 <td>
184 {# Measurement statistics #} 277 {# Measurement statistics #}
@@ -275,7 +368,8 @@ h3 {
275 {% endif %} 368 {% endif %}
276 {% endif %} 369 {% endif %}
277 </div> 370 </div>
278 {% endfor %} 371 {% endfor %}
372 </div>
279 {# Unsuccessful test #} 373 {# Unsuccessful test #}
280 {% else %} 374 {% else %}
281 <span style="font-size: 150%; font-weight: bold; color: red;">{{ test.status }} 375 <span style="font-size: 150%; font-weight: bold; color: red;">{{ test.status }}
@@ -284,6 +378,31 @@ h3 {
284 <div class="preformatted">{{ test.message }}</div> 378 <div class="preformatted">{{ test.message }}</div>
285 {% endif %} 379 {% endif %}
286 {% endfor %} 380 {% endfor %}
287</div></body> 381</div>
288</html>
289 382
383<script>
384function openChart(event, chartType, chartName) {
385 let i, tabcontents, tablinks
386 tabcontents = document.querySelectorAll(`.${chartName}_tabcontent > .tabcontent`);
387 tabcontents.forEach((tabcontent) => {
388 tabcontent.style.display = "none";
389 });
390
391 tablinks = document.querySelectorAll(`.${chartName}_tablinks > .tablinks`);
392 tablinks.forEach((tabLink) => {
393 tabLink.classList.remove('active');
394 });
395
396 const targetTab = document.getElementById(chartType)
397 targetTab.style.display = "block";
398
399 // Call resize on the ECharts instance to redraw the chart
400 const chartContainer = targetTab.querySelector('div')
401 echarts.init(chartContainer).resize();
402
403 event.currentTarget.classList.add('active');
404}
405</script>
406
407</body>
408</html>