Skip to content

Add percentage change to performance widgets

What does this MR do?

For #226987 (closed)

This MR adds text to both performance widgets (browser performance and load performance) that displays the delta (change in the metrics' values caused by the MR) as a positive or negative percentage, in addition to the delta we already show as a positive or negative number.

Technically, this MR:

  • calculates the percentage delta using the formula issue.delta / (issue.score - issue.delta) (with a range of 0-1)
  • uses our percentage unit formatter to display it (which takes a value between 0 and 1 and formats it as a percentage appropriate to the user's locale)
  • does not display the percentage change if the metric is already a percentage (if (!Number(issue.score)), so it does the same for any other non-number values)
  • does not display the percentage change if the metric did not change (same behavior as the existing delta)
  • adds a test to check for the percentage text
  • adds more cases to the spec to mimic common metric types for these widgets

Screenshots or Screencasts (strongly suggested)

before after
browser performance Screen_Shot_2021-08-17_at_21.41.18 Screen_Shot_2021-08-18_at_12.00.17
load performance Screen_Shot_2021-08-17_at_21.41.39 Screen_Shot_2021-08-18_at_12.00.56

How to setup and validate locally (strongly suggested)

  1. have a premium or higher license loaded into your gdk
  2. find/make/clone a project that has browser performance and/or load performance scans set up (or use one of these test projects: load performance, browser performance)
  3. open an MR that makes changes to the results of the performance scans (for the test projects, create an MR to merge one of the premade feature-branches)
  4. navigate to that MR and expand the performance widget

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Miranda Fluharty

Merge request reports