summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorNinette Adhikari <ninette@thehoodiefirm.com>2024-05-03 16:43:39 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-15 16:39:19 +0100
commit20fafa08540b089f1b100e00108939c3c59bd448 (patch)
tree5f5998a32305a61a71e3596f4539555bb212c16a /scripts/lib
parent314a220280840b5f0f52becc928b16d0ee7d8f2b (diff)
downloadpoky-20fafa08540b089f1b100e00108939c3c59bd448.tar.gz
oe-build-perf-report: Update chart tooltip and chart type
- Update chart tooltip format to show value as size in MB for 'rootfs size' and timestamp for 'tmpdir size' - Add commit number to tooltip - Update chart type to 'step chart' instead of 'line chart' (From OE-Core rev: fb41cbbe6008e442b6eac77308eadeae327eed7d) Signed-off-by: Ninette Adhikari <ninette@thehoodiefirm.com> 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.html31
1 files changed, 24 insertions, 7 deletions
diff --git a/scripts/lib/build_perf/html/measurement_chart.html b/scripts/lib/build_perf/html/measurement_chart.html
index 9acb3785e2..7982ec39c2 100644
--- a/scripts/lib/build_perf/html/measurement_chart.html
+++ b/scripts/lib/build_perf/html/measurement_chart.html
@@ -10,13 +10,19 @@
10 return time[0]*60 + time[1] + time[2]/60 + time[3]/3600; 10 return time[0]*60 + time[1] + time[2]/60 + time[3]/3600;
11 } 11 }
12 12
13 // Update value format to either minutes or leave as size value
14 const updateValue = (value) => {
15 // Assuming the array values are duration in the format [hours, minutes, seconds, milliseconds]
16 return Array.isArray(value) ? convertToMinute(value) : value
17 }
18
13 // Convert raw data to the format: [time, value] 19 // Convert raw data to the format: [time, value]
14 const data = rawData.map(([commit, value, time]) => { 20 const data = rawData.map(([commit, value, time]) => {
15 return [ 21 return [
16 // The Date object takes values in milliseconds rather than seconds. So to use a Unix timestamp we have to multiply it by 1000. 22 // The Date object takes values in milliseconds rather than seconds. So to use a Unix timestamp we have to multiply it by 1000.
17 new Date(time * 1000).getTime(), 23 new Date(time * 1000).getTime(),
18 // Assuming the array values are duration in the format [hours, minutes, seconds, milliseconds] 24 // Assuming the array values are duration in the format [hours, minutes, seconds, milliseconds]
19 Array.isArray(value) ? convertToMinute(value) : value 25 updateValue(value)
20 ] 26 ]
21 }); 27 });
22 28
@@ -25,11 +31,22 @@
25 tooltip: { 31 tooltip: {
26 trigger: 'axis', 32 trigger: 'axis',
27 valueFormatter: (value) => { 33 valueFormatter: (value) => {
28 const hours = Math.floor(value/60) 34 const commitNumber = rawData.filter(([commit, dataValue, time]) => updateValue(dataValue) === value)
29 const minutes = Math.floor(value % 60) 35 if ('{{ measurement.value_type.quantity }}' == 'time') {
30 const seconds = Math.floor((value * 60) % 60) 36 const hours = Math.floor(value/60)
31 return hours + ':' + minutes + ':' + seconds 37 const minutes = Math.floor(value % 60)
32 } 38 const seconds = Math.floor((value * 60) % 60)
39 return [
40 hours + ':' + minutes + ':' + seconds + ', ' +
41 'commit number: ' + commitNumber[0][0]
42 ]
43 }
44 return [
45 value.toFixed(2) + ' MB' + ', ' +
46 'commit number: ' + commitNumber[0][0]
47 ]
48 },
49
33 }, 50 },
34 xAxis: { 51 xAxis: {
35 type: 'time', 52 type: 'time',
@@ -55,7 +72,7 @@
55 { 72 {
56 name: '{{ measurement.value_type.quantity }}', 73 name: '{{ measurement.value_type.quantity }}',
57 type: 'line', 74 type: 'line',
58 smooth: true, 75 step: 'start',
59 symbol: 'none', 76 symbol: 'none',
60 data: data 77 data: data
61 } 78 }