Improve Value Stream Dashboard fractional precision
What does this MR do and why?
Resolves: #384350 (closed)
Increases the granularity of small metrics on the Value Stream Dashboard by revealing more fractional digits for small numbers:
- If value is zero, show 1 digits after the decimal point.
- If value is more than 1.0, show 1 digits after the decimal point.
- If value is less than 1.0, show 2 digits after the decimal point.
- If value is less than 0.1, show 3 digits after the decimal point.
- If value is less than 0.01, show 4 digits after the decimal point.
I decided to move the unit formatter helpers out of constants
and into utils
. This was necessary to prevent a circular dependancy between the two files, and it feels like a more appropriate place for it to live anyways.
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- Seed cycle analytics data
-
Create an environment from the UI named
production
- Open the rails console
$ rails c
- Seed DORA daily metrics in the environment using the new environment
// Within the rails console $ e = Environment.order(:id)[-1] $ 100.times { |i| Dora::DailyMetrics.create(environment_id: e.id, date: (i + 1).days.ago, deployment_frequency: rand(50), incidents_count: rand(5), lead_time_for_changes_in_seconds: rand(50000), time_to_restore_service_in_seconds: rand(100000)) }
- Enable the Exec dashboard
Feature.enable(:group_analytics_dashboards_page)
- Visit the exec dashboard:
http://gdk.test:3000/groups/${YOUR_GROUP}/-/analytics/dashboards
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.