Skip to content

Implement value stream dashbourd count service

Adam Hegyi requested to merge 404402-implement-vsd-count-metrics into master

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.

How to set up and validate locally

  1. Ensure that your GDK has ultimate license
  2. Find a group with projects and issues.
  3. 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
  1. 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
  1. 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.

Related to #404402 (closed)

Edited by Adam Hegyi

Merge request reports