diff options
author | Ninette Adhikari <ninette@thehoodiefirm.com> | 2024-05-22 16:52:52 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-24 16:59:31 +0100 |
commit | f66f8fa9f605d5dc39acb10226198b3ab40dcaa3 (patch) | |
tree | e8248db7d4291fe506f9faac0ced07635ef4c47d /scripts/lib | |
parent | 5f602c1bd57e1623ba2d46d374782e27c9547af3 (diff) | |
download | poky-f66f8fa9f605d5dc39acb10226198b3ab40dcaa3.tar.gz |
oe-build-perf-report: Add commit hash link to chart tooltip
Update tooltip to include the commit hash link to the poky repository
(From OE-Core rev: 1187a460c2608369df8de08fe52a5542e4ab6ecd)
Signed-off-by: Ninette Adhikari <ninette@thehoodiefirm.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.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', |