Skip to content

Add Time to Restore Service DORA metric

What does this MR do and why?

Adds 3rd DORA metric calculation so clients can make their DevOps processes better.

Database info

== 20220309100648 AddTimeToRestoreServiceDoraMetric: reverting ================
-- remove_column(:dora_daily_metrics, :time_to_restore_service_in_seconds, :integer)
   -> 0.0060s
== 20220309100648 AddTimeToRestoreServiceDoraMetric: reverted (0.0088s) =======

== 20220309100648 AddTimeToRestoreServiceDoraMetric: migrating ================
-- add_column(:dora_daily_metrics, :time_to_restore_service_in_seconds, :integer)
   -> 0.0080s
== 20220309100648 AddTimeToRestoreServiceDoraMetric: migrated (0.0080s) =======
== 20220309154855 AddIndexOnIssuesClosedIncidents: reverting ==================
-- transaction_open?()
   -> 0.0000s
-- indexes(:issues)
   -> 0.0516s
-- remove_index(:issues, {:algorithm=>:concurrently, :name=>"index_on_issues_closed_incidents_by_project_id_and_closed_at"})
   -> 0.0050s
== 20220309154855 AddIndexOnIssuesClosedIncidents: reverted (0.0730s) =========

== 20220309154855 AddIndexOnIssuesClosedIncidents: migrating ==================
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:issues, [:project_id, :closed_at], {:where=>"issue_type = 1 AND state_id = 2", :name=>"index_on_issues_closed_incidents_by_project_id_and_closed_at", :algorithm=>:concurrently})
   -> 0.0780s
-- add_index(:issues, [:project_id, :closed_at], {:where=>"issue_type = 1 AND state_id = 2", :name=>"index_on_issues_closed_incidents_by_project_id_and_closed_at", :algorithm=>:concurrently})
   -> 0.0196s
== 20220309154855 AddIndexOnIssuesClosedIncidents: migrated (0.1042s) =========

Index creation took 29minutes

Query explain: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/9118/commands/32246#visualize-depesz

Screenshots or screen recordings

image image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #299096 (closed)

Edited by Pavel Shutsin

Merge request reports

Loading