public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Ninette Adhikari <ninette@thehoodiefirm.com>
To: openembedded-core@lists.openembedded.org
Cc: richard.purdie@linuxfoundation.org, engineering@neighbourhood.ie,
	Ninette Adhikari <ninette@thehoodiefirm.com>
Subject: [PATCH 1/1] oe-build-perf-report: Add commit hash link to chart tooltip"
Date: Wed, 22 May 2024 16:52:52 +0200	[thread overview]
Message-ID: <20240522145252.58663-2-ninette@thehoodiefirm.com> (raw)
In-Reply-To: <20240522145252.58663-1-ninette@thehoodiefirm.com>

Update tooltip to include the commit hash link to the poky repository

Signed-off-by: Ninette Adhikari <ninette@thehoodiefirm.com>
---
 .../build_perf/html/measurement_chart.html    | 26 +++++++++----------
 scripts/oe-build-perf-report                  |  2 ++
 2 files changed, 15 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 @@
   // 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 `<strong>Duration:</strong> ${hours}:${minutes}:${seconds}, <br/> <strong>Commit number:</strong> <a href="${commitLink}" target="_blank" rel="noreferrer noopener">${sample[0][0]}</a>`
         }
-        return [
-          value.toFixed(2) + ' MB' + ', ' +
-          'commit number: ' + commitNumber[0][0]
-        ]
-      },
-
+        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>`
+      ;}
     },
     xAxis: {
       type: 'time',
diff --git a/scripts/oe-build-perf-report b/scripts/oe-build-perf-report
index 266700d294..6c3c726ee3 100755
--- a/scripts/oe-build-perf-report
+++ b/scripts/oe-build-perf-report
@@ -336,10 +336,12 @@ def print_html_report(data, id_comp, buildstats):
                 test_i = test_data['tests'][test]
                 meas_i = test_i['measurements'][meas]
                 commit_num = get_data_item(meta, 'layers.meta.commit_count')
+                commit = get_data_item(meta, 'layers.meta.commit')
                 # Add start_time for both test measurement types of sysres and disk usage
                 start_time = test_i['start_time'][0]
                 samples.append(measurement_stats(meas_i, '', start_time))
                 samples[-1]['commit_num'] = commit_num
+                samples[-1]['commit'] = commit
 
             absdiff = samples[-1]['val_cls'](samples[-1]['mean'] - samples[id_comp]['mean'])
             reldiff = absdiff * 100 / samples[id_comp]['mean']
-- 
2.44.0



  reply	other threads:[~2024-05-22 14:53 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 14:41 [PATCH 0/3] Improvements for performance test report view Ninette Adhikari
2024-04-15 14:41 ` [PATCH 1/3] oe-build-perf-report: Add apache echarts to make report interactive Ninette Adhikari
2024-04-16 16:39   ` [OE-core] " Ross Burton
2024-04-18 14:23     ` [PATCH v2] oe-build-perf-report: Update chart tooltip format Ninette Adhikari
2024-04-15 14:41 ` [PATCH 2/3] oe-build-perf-report: Display more than 300 commits and date instead of commit number Ninette Adhikari
2024-04-15 14:41 ` [PATCH 3/3] oe-build-perf-report: Improve report styling and add descriptions Ninette Adhikari
2024-04-15 14:52   ` Patchtest results for " patchtest
2024-04-16 14:49 ` [OE-core] [PATCH 0/3] Improvements for performance test report view Richard Purdie
2024-05-03 14:43   ` [PATCH v2 0/5] " Ninette Adhikari
2024-05-03 14:43     ` [PATCH v2 1/5] oe-build-perf-report: Add apache echarts to make report interactive Ninette Adhikari
2024-05-15 15:56       ` Richard Purdie
2024-05-15 16:00         ` [OE-core] " Ross Burton
2024-05-22 14:52         ` [PATCH 0/1] oe-build-perf-report: Update tooltip to include commit link Ninette Adhikari
2024-05-22 14:52           ` Ninette Adhikari [this message]
2024-05-22 15:03             ` Patchtest results for [PATCH 1/1] oe-build-perf-report: Add commit hash link to chart tooltip" patchtest
2024-05-24 16:01             ` Richard Purdie
2024-05-22 15:16         ` [PATCH v2 1/5] oe-build-perf-report: Add apache echarts to make report interactive Ninette Adhikari
2024-05-24 16:02           ` Richard Purdie
2024-05-03 14:43     ` [PATCH v2 2/5] oe-build-perf-report: Display more than 300 commits and date instead of commit number Ninette Adhikari
2024-05-03 14:43     ` [PATCH v2 3/5] oe-build-perf-report: Improve report styling and add descriptions Ninette Adhikari
2024-05-03 14:43     ` [PATCH v2 4/5] oe-build-perf-report: Update chart tooltip and chart type Ninette Adhikari
2024-05-03 14:43     ` [PATCH v2 5/5] oe-build-perf-report: Add dark mode Ninette Adhikari
2024-05-03 17:22     ` [PATCH v2 0/5] Improvements for performance test report view Randy MacLeod
     [not found]     ` <17CC0A5CB7913FF6.8557@lists.openembedded.org>
2024-05-03 18:10       ` [OE-core] " Randy MacLeod
2024-05-07 14:17         ` Ninette Adhikari
2024-05-08 15:53           ` Randy MacLeod
2024-05-13 14:28             ` Ninette Adhikari
2024-05-15 12:27               ` Ross Burton
2024-04-16 20:40 ` [OE-core] [PATCH 0/3] " Randy MacLeod

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240522145252.58663-2-ninette@thehoodiefirm.com \
    --to=ninette@thehoodiefirm.com \
    --cc=engineering@neighbourhood.ie \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox