Set sparkline value to 0 if the metric is missing
What does this MR do and why?
Checks if the metric exists in the sparkline data. otherwise defaults to 0
Related to Exec Dashboard - Failing request for summary en... (#384551 - closed)
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
Enable dashboard
- Enable the dashboards page
Feature.enable(:group_analytics_dashboards_page)
- Ensure you're on the ultimate plan
- Visit any Group > Analytics > Dashboards
Seed data
- Create a project in the group
-
Create an environment from the UI named
production
- Open the rails console
rails c
- Find the environment
id
// Within the rails console $ e = Environment.order(:id)[-1]
- Seed DORA daily metrics in the environment using the environment
// Within the rails console $ 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)) }
Viewing the dashboard
Navigate to the the exec dashboard for the group and specify the project path in the `query parameter
// For example
// Group: flightjs
// Project: flightjs/flight
Navigate to http://gdk.test:3000/groups/flightjs/-/analytics/dashboards?query=flightjs/flight
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.
Edited by Ezekiel Kigbo