Skip to content

Adds panels to show runner usage breakdown

Miguel Rincon requested to merge 440207-add-minutes-breakdown into master

What does this MR do and why?

This change adds a new panel in the group runners dashboard to shows the usage of compute minutes by runner and project.

Changes behind feature flag :runners_dashboard_for_groups.

Is this a big MR?!

Well, a bit, most of the line changes come from changes in runner_usage_spec.js as we add new describe blocks and move code around.

Actually, the important changes here:

  1. Added props to runner_usage.vue, so they can pass parameters to queries, to fetch group metrics.
  2. Added arguments to the corresponding GraphQL queries, to fetch group metrics.
  3. Update arguments in the a GraphQL mutation, so they match the queries.

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.

Screenshots or screen recordings

http://gdk.test:3000/groups/my-group/-/runners/dashboard

image

How to set up and validate locally

Activate the dashboard feature

  1. Enable the feature flag :runners_dashboard_for_groups.
  2. Ensure you have an Ultimate license associated with your GDK

Setup ClickHouse data

  1. Follow https://docs.gitlab.com/ee/development/database/clickhouse/clickhouse_within_gitlab.html#gdk-setup up to and including running migrations

  2. Go to the shell in your GDK gitlab directory and run bundle exec rake "gitlab:seed:runner_fleet". This will seed your GDK with some runners and jobs required for testing this MR.

  3. Run the following in the rails console:

    ::Ci::Build.where.not(finished_at: nil).order(id: :desc).limit(5000).each{|build| ::Ci::FinishedBuildChSyncEvent.upsert({ build_id: build.id, build_finished_at: build.finished_at }, unique_by: [:build_id, :partition]) }
    ClickHouse::DataIngestion::CiFinishedBuildsSyncService.new.execute

Verify this change

  1. Visit the group's dashboard.

Related to #440207 (closed)

Edited by Miguel Rincon

Merge request reports