diff options
Diffstat (limited to 'scripts/lib/build_perf')
| -rw-r--r-- | scripts/lib/build_perf/html/measurement_chart.html | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/scripts/lib/build_perf/html/measurement_chart.html b/scripts/lib/build_perf/html/measurement_chart.html index ad4a93ed02..05bd84e6ce 100644 --- a/scripts/lib/build_perf/html/measurement_chart.html +++ b/scripts/lib/build_perf/html/measurement_chart.html | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // Get raw data | 2 | // Get raw data |
| 3 | const rawData = [ | 3 | const rawData = [ |
| 4 | {% for sample in measurement.samples %} | 4 | {% for sample in measurement.samples %} |
| 5 | [{{ sample.commit_num }}, {{ sample.mean.gv_value() }}, {{ sample.start_time }}], | 5 | [{{ sample.commit_num }}, {{ sample.mean.gv_value() }}, {{ sample.start_time }}, '{{sample.commit}}'], |
| 6 | {% endfor %} | 6 | {% endfor %} |
| 7 | ]; | 7 | ]; |
| 8 | 8 | ||
| @@ -30,23 +30,23 @@ | |||
| 30 | const option = { | 30 | const option = { |
| 31 | tooltip: { | 31 | tooltip: { |
| 32 | trigger: 'axis', | 32 | trigger: 'axis', |
| 33 | valueFormatter: (value) => { | 33 | enterable: true, |
| 34 | const commitNumber = rawData.filter(([commit, dataValue, time]) => updateValue(dataValue) === value) | 34 | position: function (point, params, dom, rect, size) { |
| 35 | return [point[0]-150, '10%']; | ||
| 36 | }, | ||
| 37 | formatter: function (param) { | ||
| 38 | const value = param[0].value[1] | ||
| 39 | const sample = rawData.filter(([commit, dataValue]) => updateValue(dataValue) === value) | ||
| 40 | // Add commit hash to the tooltip as a link | ||
| 41 | const commitLink = `https://git.yoctoproject.org/poky/commit/?id=${sample[0][3]}` | ||
| 35 | if ('{{ measurement.value_type.quantity }}' == 'time') { | 42 | if ('{{ measurement.value_type.quantity }}' == 'time') { |
| 36 | const hours = Math.floor(value/60) | 43 | const hours = Math.floor(value/60) |
| 37 | const minutes = Math.floor(value % 60) | 44 | const minutes = Math.floor(value % 60) |
| 38 | const seconds = Math.floor((value * 60) % 60) | 45 | const seconds = Math.floor((value * 60) % 60) |
| 39 | return [ | 46 | return `<strong>Duration:</strong> ${hours}:${minutes}:${seconds}, <br/> <strong>Commit number:</strong> <a href="${commitLink}" target="_blank" rel="noreferrer noopener">${sample[0][0]}</a>` |
| 40 | hours + ':' + minutes + ':' + seconds + ', ' + | ||
| 41 | 'commit number: ' + commitNumber[0][0] | ||
| 42 | ] | ||
| 43 | } | 47 | } |
| 44 | return [ | 48 | return `<strong>Size:</strong> ${value.toFixed(2)} MB, <br/> <strong>Commit number:</strong> <a href="${commitLink}" target="_blank" rel="noreferrer noopener">${sample[0][0]}</a>` |
| 45 | value.toFixed(2) + ' MB' + ', ' + | 49 | ;} |
| 46 | 'commit number: ' + commitNumber[0][0] | ||
| 47 | ] | ||
| 48 | }, | ||
| 49 | |||
| 50 | }, | 50 | }, |
| 51 | xAxis: { | 51 | xAxis: { |
| 52 | type: 'time', | 52 | type: 'time', |
