summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorNinette Adhikari <13760198+ninetteadhikari@users.noreply.github.com>2024-05-03 16:43:38 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-15 16:39:19 +0100
commit314a220280840b5f0f52becc928b16d0ee7d8f2b (patch)
tree1c1ef9222177542aeed9425f509da1bef17ea1bb /scripts/lib
parent99861c17e7a47cbbd492f98336439a5ab3e8742e (diff)
downloadpoky-314a220280840b5f0f52becc928b16d0ee7d8f2b.tar.gz
oe-build-perf-report: Improve report styling and add descriptions
Styling updates are added including page margin, labels for x and y axis, tooltip, and section descriptions. (From OE-Core rev: 2a2568fcf1a3f8e467bd814f4fb13dffae8ec61d) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/build_perf/html/measurement_chart.html28
-rw-r--r--scripts/lib/build_perf/html/report.html90
-rw-r--r--scripts/lib/build_perf/report.py3
3 files changed, 80 insertions, 41 deletions
diff --git a/scripts/lib/build_perf/html/measurement_chart.html b/scripts/lib/build_perf/html/measurement_chart.html
index ffec3d09db..9acb3785e2 100644
--- a/scripts/lib/build_perf/html/measurement_chart.html
+++ b/scripts/lib/build_perf/html/measurement_chart.html
@@ -13,8 +13,10 @@
13 // Convert raw data to the format: [time, value] 13 // Convert raw data to the format: [time, value]
14 const data = rawData.map(([commit, value, time]) => { 14 const data = rawData.map(([commit, value, time]) => {
15 return [ 15 return [
16 new Date(time * 1000).getTime(), // The Date object takes values in milliseconds rather than seconds. So to use a Unix timestamp we have to multiply it by 1000. 16 // The Date object takes values in milliseconds rather than seconds. So to use a Unix timestamp we have to multiply it by 1000.
17 Array.isArray(value) ? convertToMinute(value) : value // Assuming the array values are duration in the format [hours, minutes, seconds, milliseconds] 17 new Date(time * 1000).getTime(),
18 // Assuming the array values are duration in the format [hours, minutes, seconds, milliseconds]
19 Array.isArray(value) ? convertToMinute(value) : value
18 ] 20 ]
19 }); 21 });
20 22
@@ -22,16 +24,18 @@
22 const option = { 24 const option = {
23 tooltip: { 25 tooltip: {
24 trigger: 'axis', 26 trigger: 'axis',
25 position: function (pt) { 27 valueFormatter: (value) => {
26 return [pt[0], '10%']; 28 const hours = Math.floor(value/60)
27 }, 29 const minutes = Math.floor(value % 60)
28 valueFormatter: (value) => value.toFixed(2) 30 const seconds = Math.floor((value * 60) % 60)
31 return hours + ':' + minutes + ':' + seconds
32 }
29 }, 33 },
30 xAxis: { 34 xAxis: {
31 type: 'time', 35 type: 'time',
32 }, 36 },
33 yAxis: { 37 yAxis: {
34 name: '{{ measurement.value_type.quantity }}' == 'time' ? 'Duration (minutes)' : 'Disk size (MB)', 38 name: '{{ measurement.value_type.quantity }}' == 'time' ? 'Duration in minutes' : 'Disk size in MB',
35 type: 'value', 39 type: 'value',
36 min: function(value) { 40 min: function(value) {
37 return Math.round(value.min - 0.5); 41 return Math.round(value.min - 0.5);
@@ -42,14 +46,10 @@
42 }, 46 },
43 dataZoom: [ 47 dataZoom: [
44 { 48 {
45 type: 'inside', 49 type: 'slider',
46 start: 0, 50 xAxisIndex: 0,
47 end: 100 51 filterMode: 'none'
48 }, 52 },
49 {
50 start: 0,
51 end: 100
52 }
53 ], 53 ],
54 series: [ 54 series: [
55 { 55 {
diff --git a/scripts/lib/build_perf/html/report.html b/scripts/lib/build_perf/html/report.html
index 653fd985bc..4cd240760a 100644
--- a/scripts/lib/build_perf/html/report.html
+++ b/scripts/lib/build_perf/html/report.html
@@ -24,23 +24,15 @@
24 text-align: left; 24 text-align: left;
25 border-collapse: collapse; 25 border-collapse: collapse;
26} 26}
27.meta-table tr:nth-child(even){background-color: #f2f2f2}
28meta-table th, .meta-table td {
29 padding: 4px;
30}
31.summary { 27.summary {
32 margin: 0;
33 font-size: 14px; 28 font-size: 14px;
34 text-align: left; 29 text-align: left;
35 border-collapse: collapse; 30 border-collapse: collapse;
36} 31}
37summary th, .meta-table td {
38 padding: 4px;
39}
40.measurement { 32.measurement {
41 padding: 8px 0px 8px 8px; 33 padding: 8px 0px 8px 8px;
42 border: 2px solid #f0f0f0; 34 border: 2px solid #f0f0f0;
43 margin-bottom: 10px; 35 margin: 1.5rem 0;
44} 36}
45.details { 37.details {
46 margin: 0; 38 margin: 0;
@@ -60,18 +52,58 @@ summary th, .meta-table td {
60 background-color: #f0f0f0; 52 background-color: #f0f0f0;
61 margin-left: 10px; 53 margin-left: 10px;
62} 54}
63hr { 55.card-container {
64 color: #f0f0f0; 56 border-bottom-width: 1px;
57 padding: 1.25rem 3rem;
58 box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
59 border-radius: 0.25rem;
60}
61body {
62 font-family: 'Helvetica', sans-serif;
63 margin: 3rem 8rem;
64}
65h1 {
66 text-align: center;
65} 67}
66h2 { 68h2 {
67 font-size: 20px; 69 font-size: 1.5rem;
68 margin-bottom: 0px; 70 margin-bottom: 0px;
69 color: #707070; 71 color: #707070;
72 padding-top: 1.5rem;
70} 73}
71h3 { 74h3 {
72 font-size: 16px; 75 font-size: 1.3rem;
73 margin: 0px; 76 margin: 0px;
74 color: #707070; 77 color: #707070;
78 padding: 1.5rem 0;
79}
80h4 {
81 font-size: 14px;
82 font-weight: lighter;
83 line-height: 1.2rem;
84 margin: auto;
85 padding-top: 1rem;
86}
87table {
88 margin-top: 1.5rem;
89 line-height: 2rem;
90}
91tr {
92 border-bottom: 1px solid #e5e7eb;
93}
94tr:first-child {
95 border-bottom: 1px solid #9ca3af;
96}
97tr:last-child {
98 border-bottom: none;
99}
100a {
101 text-decoration: none;
102 font-weight: bold;
103 color: #0000EE;
104}
105a:hover {
106 color: #8080ff;
75} 107}
76</style> 108</style>
77 109
@@ -79,13 +111,14 @@ h3 {
79</head> 111</head>
80 112
81{% macro poky_link(commit) -%} 113{% macro poky_link(commit) -%}
82 <a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?id={{ commit }}">{{ commit[0:11] }}</a> 114 <a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?id={{ commit }}">{{ commit[0:11] }}</a>
83{%- endmacro %} 115{%- endmacro %}
84 116
85<body><div style="width: 700px"> 117<body><div>
118 <h1 style="text-align: center;">Performance Test Report</h1>
86 {# Test metadata #} 119 {# Test metadata #}
87 <h2>General</h2> 120 <h2>General</h2>
88 <hr> 121 <h4>The table provides an overview of the comparison between two selected commits from the same branch.</h4>
89 <table class="meta-table" style="width: 100%"> 122 <table class="meta-table" style="width: 100%">
90 <tr> 123 <tr>
91 <th></th> 124 <th></th>
@@ -108,19 +141,21 @@ h3 {
108 141
109 {# Test result summary #} 142 {# Test result summary #}
110 <h2>Test result summary</h2> 143 <h2>Test result summary</h2>
111 <hr> 144 <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>
112 <table class="summary" style="width: 100%"> 145 <table class="summary" style="width: 100%">
146 <tr>
147 <th>Test name</th>
148 <th>Measurement description</th>
149 <th>Mean value</th>
150 <th>Absolute difference</th>
151 <th>Relative difference</th>
152 </tr>
113 {% for test in test_data %} 153 {% for test in test_data %}
114 {% if loop.index is even %}
115 {% set row_style = 'style="background-color: #f2f2f2"' %}
116 {% else %}
117 {% set row_style = 'style="background-color: #ffffff"' %}
118 {% endif %}
119 {% if test.status == 'SUCCESS' %} 154 {% if test.status == 'SUCCESS' %}
120 {% for measurement in test.measurements %} 155 {% for measurement in test.measurements %}
121 <tr {{ row_style }}> 156 <tr {{ row_style }}>
122 {% if loop.index == 1 %} 157 {% if loop.index == 1 %}
123 <td>{{ test.name }}: {{ test.description }}</td> 158 <td><a href=#{{test.name}}>{{ test.name }}: {{ test.description }}</a></td>
124 {% else %} 159 {% else %}
125 {# add empty cell in place of the test name#} 160 {# add empty cell in place of the test name#}
126 <td></td> 161 <td></td>
@@ -149,10 +184,12 @@ h3 {
149 </table> 184 </table>
150 185
151 {# Detailed test results #} 186 {# Detailed test results #}
187 <h2>Test details</h2>
188 <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>
152 {% for test in test_data %} 189 {% for test in test_data %}
153 <h2>{{ test.name }}: {{ test.description }}</h2> 190 <h3 style="color: #000;" id={{test.name}}>{{ test.name }}: {{ test.description }}</h3>
154 <hr>
155 {% if test.status == 'SUCCESS' %} 191 {% if test.status == 'SUCCESS' %}
192 <div class="card-container">
156 {% for measurement in test.measurements %} 193 {% for measurement in test.measurements %}
157 <div class="measurement"> 194 <div class="measurement">
158 <h3>{{ measurement.description }}</h3> 195 <h3>{{ measurement.description }}</h3>
@@ -271,7 +308,8 @@ h3 {
271 {% endif %} 308 {% endif %}
272 {% endif %} 309 {% endif %}
273 </div> 310 </div>
274 {% endfor %} 311 {% endfor %}
312 </div>
275 {# Unsuccessful test #} 313 {# Unsuccessful test #}
276 {% else %} 314 {% else %}
277 <span style="font-size: 150%; font-weight: bold; color: red;">{{ test.status }} 315 <span style="font-size: 150%; font-weight: bold; color: red;">{{ test.status }}
diff --git a/scripts/lib/build_perf/report.py b/scripts/lib/build_perf/report.py
index 82c56830d7..f4e6a92e09 100644
--- a/scripts/lib/build_perf/report.py
+++ b/scripts/lib/build_perf/report.py
@@ -319,7 +319,8 @@ def measurement_stats(meas, prefix='', time=0):
319 stats['quantity'] = val_cls.quantity 319 stats['quantity'] = val_cls.quantity
320 stats[prefix + 'sample_cnt'] = len(values) 320 stats[prefix + 'sample_cnt'] = len(values)
321 321
322 start_time = time # Add start time for both type sysres and disk usage 322 # Add start time for both type sysres and disk usage
323 start_time = time
323 mean_val = val_cls(mean(values)) 324 mean_val = val_cls(mean(values))
324 min_val = val_cls(min(values)) 325 min_val = val_cls(min(values))
325 max_val = val_cls(max(values)) 326 max_val = val_cls(max(values))