[PATCH v2] oe-build-perf-report: Update chart tooltip format

Ninette Adhikari
2024-04-18T14:24:03Z

Update chart tooltip format to show value as size in MB for 'rootfs size'
and timestamp for 'tmpdir size'

Signed-off-by: Ninette Adhikari <ninette@thehoodiefirm.com>
---
scripts/lib/build_perf/html/measurement_chart.html | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/build_perf/html/measurement_chart.html b/scripts/lib/build_perf/html/measurement_chart.html
index 9acb3785e2..07e92dfe78 100644
--- a/scripts/lib/build_perf/html/measurement_chart.html
+++ b/scripts/lib/build_perf/html/measurement_chart.html
@@ -25,10 +25,13 @@
tooltip: {
trigger: 'axis',
valueFormatter: (value) => {
- const hours = Math.floor(value/60)
- const minutes = Math.floor(value % 60)
- const seconds = Math.floor((value * 60) % 60)
- return hours + ':' + minutes + ':' + seconds
+ if ('{{ measurement.value_type.quantity }}' == 'time') {
+ const hours = Math.floor(value/60)
+ const minutes = Math.floor(value % 60)
+ const seconds = Math.floor((value * 60) % 60)
+ return hours + ':' + minutes + ':' + seconds
+ }
+ return value.toFixed(2) + ' MB'
}
},
xAxis: {
--
2.44.0