Skip to content

Migrate SearchCounter to internal events

What does this MR do and why?

Related to #448285 (closed).

This migrates the total count metrics from SearchCounter class to Internal Events, while keeping the original Redis keys. Instead of migrating the keys to the new format in TotalCountMetric, the new keys are aliased in a YAML file and point to the old ones, so that the count continues in the old keys and we can keep the past counts.

The following metrics are converted to internal events:

MR acceptance checklist

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

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Checkout master and fire the event a few times (doing a search).
  2. Run in console and note the value:
definition = Gitlab::Usage::MetricDefinition.definitions['counts.all_searches']
Gitlab::Usage::Metric.new(definition).with_value
  1. Checkout MR branch and run the code in the console again. The value should be identical.
  2. Fire the event a few more times and check if the value got incremented.
  3. Repeat for a navbar search
Edited by Piotr Skorupa

Merge request reports