From f66f8fa9f605d5dc39acb10226198b3ab40dcaa3 Mon Sep 17 00:00:00 2001 From: Ninette Adhikari Date: Wed, 22 May 2024 16:52:52 +0200 Subject: 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 Signed-off-by: Richard Purdie --- scripts/lib/build_perf/html/measurement_chart.html | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'scripts/lib/build_perf/html') 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 @@ // Get raw data const rawData = [ {% for sample in measurement.samples %} - [{{ sample.commit_num }}, {{ sample.mean.gv_value() }}, {{ sample.start_time }}], + [{{ sample.commit_num }}, {{ sample.mean.gv_value() }}, {{ sample.start_time }}, '{{sample.commit}}'], {% endfor %} ]; @@ -30,23 +30,23 @@ const option = { tooltip: { trigger: 'axis', - valueFormatter: (value) => { - const commitNumber = rawData.filter(([commit, dataValue, time]) => updateValue(dataValue) === value) + enterable: true, + position: function (point, params, dom, rect, size) { + return [point[0]-150, '10%']; + }, + formatter: function (param) { + const value = param[0].value[1] + const sample = rawData.filter(([commit, dataValue]) => updateValue(dataValue) === value) + // Add commit hash to the tooltip as a link + const commitLink = `https://git.yoctoproject.org/poky/commit/?id=${sample[0][3]}` 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 + ', ' + - 'commit number: ' + commitNumber[0][0] - ] + return `Duration: ${hours}:${minutes}:${seconds},
Commit number: ${sample[0][0]}` } - return [ - value.toFixed(2) + ' MB' + ', ' + - 'commit number: ' + commitNumber[0][0] - ] - }, - + return `Size: ${value.toFixed(2)} MB,
Commit number: ${sample[0][0]}` + ;} }, xAxis: { type: 'time', -- cgit v1.2.3-54-g00ecf