Skip to content

Move work item weight counters to CE

euko requested to merge move-wi-weight-counter-to-ce into master

What does this MR do and why?

Move the event counter users_updating_weight_estimate, which tracks an EE feature, to the CE section. The counter itself would only increment if used within EE instances and return 0 from CE instances.

Why? We want to be able to aggregate the count into the metrics such as users_work_items which resides in the CE section rather than creating a separate EE exclusive aggregate metric (e.g., users_work_items_ee)

How to set up and validate locally

To test the counter's been added to aggregate metrics correctly, follow these steps.

This example considers counts_weekly.aggregated_metrics.users_work_items, one of the updated aggregated metrics.

  1. On master branch, execute the following line and note the value.
ServicePing::BuildPayload.new.execute.dig(*"counts_weekly.aggregated_metrics.users_work_items".split('.'))
  1. In the rails console, increment the counter users_updating_weight_estimate.

Since the aggregation happens weekly for the example aggregated metric, time argument should be set to 1.week.ago.

The value here is going to be an author id (we will arbitrarily use 999.)

Gitlab::UsageDataCounters::HLLRedisCounter.track_event(:users_updating_weight_estimate, values: 999, time: 1.week.ago)
  1. Check out the value of the aggregated metric on master and confirm the value didn't change.
ServicePing::BuildPayload.new.execute.dig(*"counts_weekly.aggregated_metrics.users_work_items".split('.'))
  1. Check out the value of the aggregated metric on this MR's branch and confirm the value's been updated.

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 euko

Merge request reports