summaryrefslogtreecommitdiffstats
path: root/scripts/lib/build_perf/html/report.html
diff options
context:
space:
mode:
authorNinette Adhikari <ninette.adhikari@gmail.com>2025-01-27 14:20:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-02-09 22:23:30 +0000
commit9f3127060027a24995c3c361cbda964d2c59d039 (patch)
treec39492feaecddedf2e777b381bf3b205d44e3c5c /scripts/lib/build_perf/html/report.html
parente0a7a6eb096d94010d159456d8a6e86b36ec7a6a (diff)
downloadpoky-9f3127060027a24995c3c361cbda964d2c59d039.tar.gz
scripts/buildperf: Add chart tabs for commit count/time
We triggered a test of an older revision to narrow down when performance changed. The issue is that git's timestamps are granular to 1s. We'll usually merge a set of commits at the same time so they will all have the same timestamp for a block of them. This means that even if we use the commit date, all the points can't be distinguished on the graph. The author date doesn't work either as the commits are not merged in author date order. To solve this this patch adds the commit_count chart as a separate tab next to the start_time chart (From OE-Core rev: b263edd33f6c895238d81ef148c0445fcd0aa268) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/build_perf/html/report.html')
-rw-r--r--scripts/lib/build_perf/html/report.html71
1 files changed, 67 insertions, 4 deletions
diff --git a/scripts/lib/build_perf/html/report.html b/scripts/lib/build_perf/html/report.html
index 537ed3ee52..28cd80e738 100644
--- a/scripts/lib/build_perf/html/report.html
+++ b/scripts/lib/build_perf/html/report.html
@@ -9,7 +9,8 @@
9{% for test in test_data %} 9{% for test in test_data %}
10 {% if test.status == 'SUCCESS' %} 10 {% if test.status == 'SUCCESS' %}
11 {% for measurement in test.measurements %} 11 {% for measurement in test.measurements %}
12 {% 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' %}
13 {% include 'measurement_chart.html' %} 14 {% include 'measurement_chart.html' %}
14 {% endfor %} 15 {% endfor %}
15 {% endif %} 16 {% endif %}
@@ -116,6 +117,22 @@ a {
116a:hover { 117a:hover {
117 color: #8080ff; 118 color: #8080ff;
118} 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}
119@media (prefers-color-scheme: dark) { 136@media (prefers-color-scheme: dark) {
120 :root { 137 :root {
121 --text: #e9e8fa; 138 --text: #e9e8fa;
@@ -126,6 +143,16 @@ a:hover {
126 --trborder: #212936; 143 --trborder: #212936;
127 --chartborder: #b1b0bf; 144 --chartborder: #b1b0bf;
128 } 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 }
129} 156}
130</style> 157</style>
131 158
@@ -233,7 +260,18 @@ a:hover {
233 <tr> 260 <tr>
234 <td style="width: 75%"> 261 <td style="width: 75%">
235 {# Linechart #} 262 {# Linechart #}
236 <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>
237 </td> 275 </td>
238 <td> 276 <td>
239 {# Measurement statistics #} 277 {# Measurement statistics #}
@@ -340,6 +378,31 @@ a:hover {
340 <div class="preformatted">{{ test.message }}</div> 378 <div class="preformatted">{{ test.message }}</div>
341 {% endif %} 379 {% endif %}
342 {% endfor %} 380 {% endfor %}
343</div></body> 381</div>
344</html>
345 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>