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 | ||
load performance |
How to setup and validate locally (strongly suggested)
- have a premium or higher license loaded into your gdk
- 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)
- 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-branch
es) - navigate to that MR and expand the performance widget
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.)
Edited by Miranda Fluharty