Add members to VSD counts
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
- Use the following script to seed a VSD group `FILTER=cycle_analytics SEED_VSA=1 bundle exec rake db:seed_fu
- 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
- 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
- Verify if the count member is correct
Analytics::ValueStreamDashboard::Count.where(namespace_id: Group.last.id, metric: 'direct_members')
Edited by Felipe Artur