Skip to content

Commit 4a25aa0

Browse files
oe-build-perf-report: Remove redundant chart options and update chart tooltip format and datazoom
1 parent f05e4d5 commit 4a25aa0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

scripts/lib/build_perf/html/measurement_chart.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,29 @@
1313
// Convert raw data to the format: [time, value]
1414
const data = rawData.map(([commit, value, time]) => {
1515
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.
17-
Array.isArray(value) ? convertToMinute(value) : value // Assuming the array values are duration in the format [hours, minutes, seconds, milliseconds]
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+
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
1820
]
1921
});
2022

2123
// Set chart options
2224
const option = {
2325
tooltip: {
2426
trigger: 'axis',
25-
position: function (pt) {
26-
return [pt[0], '10%'];
27-
},
28-
valueFormatter: (value) => value.toFixed(2)
27+
valueFormatter: (value) => {
28+
const hours = Math.floor(value/60)
29+
const minutes = Math.floor(value % 60)
30+
const seconds = Math.floor((value * 60) % 60)
31+
return hours + ':' + minutes + ':' + seconds
32+
}
2933
},
3034
xAxis: {
3135
type: 'time',
3236
},
3337
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',
3539
type: 'value',
3640
min: function(value) {
3741
return Math.round(value.min - 0.5);
@@ -42,14 +46,10 @@
4246
},
4347
dataZoom: [
4448
{
45-
type: 'inside',
46-
start: 0,
47-
end: 100
49+
type: 'slider',
50+
xAxisIndex: 0,
51+
filterMode: 'none'
4852
},
49-
{
50-
start: 0,
51-
end: 100
52-
}
5353
],
5454
series: [
5555
{

0 commit comments

Comments
 (0)