Skip to content

Modify the metric to a database metric with batches for performance improvement

What does this MR do and why?

This MR addresses performance considerations in the metrics collection of duo settings for groups. The metric is now a database metric and uses batches to reduce the chance of individual queries from exceeding the maximum query time or timing out.

References

Related to #572932

How to set up and validate locally

  1. Create projects and groups in your local gitlab instance, and toggle the Duo availability settings in the instance admin level, group level, and project level.
  2. Open the rails console
gdk rails console
  1. Execute the service ping report generation
payload = Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values)
  1. Validate the counts are as expected for the instance, group, projects.
payload["settings"]["count_groups_duo_availability_never_on"]
payload["settings"]["count_groups_duo_availability_default_off"]
payload["settings"]["count_groups_duo_availability_default_on"]
payload["settings"]["count_projects_duo_features_enabled"]
payload["settings"]["duo_availability"]

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #572932

Merge request reports

Loading