Skip to content

Migrate ci_templates total metrics

What does this MR do and why?

Use new recommended aggregated metric syntax for first batch of total metrics

Resolves subtask from #373830 (comment 1126596388)

Screenshots or screen recordings

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

How to set up and validate locally

In rails console

  1. Seed data
Gitlab::UsageDataCounters::HLLRedisCounter.track_event('p_ci_templates_implicit_auto_devops', values: 1, time: 3.days.ago)
Gitlab::UsageDataCounters::HLLRedisCounter.track_event('p_ci_templates_5_min_production_app', values: 2, time: 3.days.ago)
  1. Get service ping payload
payload = ServicePing::BuildPayload.new.execute
  1. Get metric data
payload.dig(*"redis_hll_counters.ci_templates.ci_templates_total_unique_counts_weekly".split('.'))

You can repeat step 2 and 3 on both master and feature branch to compare that there are no changes to returned data You can test any metric in this MR in the same way, just use any combination of the options.events: in step 1st and metric key_path in step 3rd

MR acceptance checklist

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

Merge request reports