Skip to content

Add members to VSD counts

Felipe Artur requested to merge issue_423513 into master

What does this MR do and why?

Implement group direct members count metric. Adds direct_members metric enum to Analytics::ValueStreamDashboard::Count and define the necessary scopes at Analytics::ValueStreamDashboard::TopLevelGroupCounterService.

related to #423513 (closed)

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.

How to set up and validate locally

  1. Use the following script to seed a VSD group `FILTER=cycle_analytics SEED_VSA=1 bundle exec rake db:seed_fu
  2. Modify the code so we can run an aggregation before the end of the month
# In the `Analytics::ValueStreamDashboard::CountWorker` (`ee/app/workers/analytics/value_stream_dashboard/count_worker.rb`), override the should_perform? method
def should_perform?
  true
end
  1. Open rails console and run the following:
  # Creates an aggregation for the latest group
  Analytics::ValueStreamDashboard::Aggregation.upsert({ namespace_id: Group.last.id, enabled: true })
  # Perform aggregation on count worker
  Analytics::ValueStreamDashboard::CountWorker.new.perform
  1. Verify if the count member is correct
  Analytics::ValueStreamDashboard::Count.where(namespace_id: Group.last.id, metric: 'direct_members')
Edited by Felipe Artur

Merge request reports