diff options
-rw-r--r-- | scripts/lib/build_perf/html/measurement_chart.html | 31 |
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 | } |