Skip to content

Migrate project_imports metrics to instrumentation classes

Piotr Skorupa requested to merge 351486-migrate-project-imports-metrics into master

What does this MR do and why?

Related to #351486 (closed).

This migrates project_imports metrics in Gitlab::UsageData to instrumentation classes.

Usually, this means that the metric can be removed from Gitlab::UsageData, because it will be picked up using the metadata in the metric definitions. However, for now they need to be left in Gitlab::UsageData using the add_metric method, for the total to be calculated.

In the next iteration the total will be moved to be calculated in a separate instrumentation class, which will execute a redundant query since instrumentation class values can't rely on results of other metrics, but it will reduce complexity nonetheless.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

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.

Edited by Piotr Skorupa

Merge request reports