Skip to content

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
Screenshot_2023-02-14_at_3.54.20_pm Screenshot_2023-02-14_at_3.53.44_pm

How to set up and validate locally

Enable dashboard

  1. Enable the dashboards page
    Feature.enable(:group_analytics_dashboards_page)
  2. Ensure you're on the ultimate plan
  3. Visit any Group > Analytics > Dashboards

Seed data

  1. Create a project in the group
  2. Create an environment from the UI named production
  3. Open the rails console
    rails c
  4. Find the environment id
    // Within the rails console
    $ e = Environment.order(:id)[-1]
  5. 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.

Edited by Ezekiel Kigbo

Merge request reports