Implement value stream dashbourd count service
What does this MR do and why?
This MR implements the batch counter queries for the value stream dashboard page. The following metrics are added:
- group count
- MR count
- pipeline count
Queries
The queries are using the each_batch_count
helper method.
- group count: https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/19249/commands/63646
- MR count: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/19249/commands/63648
- Pipeline count: https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/19286/commands/63649
How to set up and validate locally
- Ensure that your GDK has ultimate license
- Find a group with projects and issues.
- Modify the code so it runs any time (normally the worker only runs around the end of 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
- Create an aggregation record, enable the feature flags and run the worker:
Feature.enable(:value_stream_dashboard_on_off_setting)
Analytics::ValueStreamDashboard::Aggregation.create(namespace: Group.find(1), enabled: true)
Analytics::ValueStreamDashboard::CountWorker.new.perform
- Verify that it collected some counts (especially groups, MRs and pipelines):
Analytics::ValueStreamDashboard::Count.group(:metric).sum(:count)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #404402 (closed)
Edited by Adam Hegyi