Skip to content

Add `Usage by project` table to group data transfer dashboard

Peter Hegman requested to merge 386406-project-table into master

What does this MR do and why?

Related to #386406

We are starting to build a dashboard to monitor egress data transfer. The first dashboard will be at the group level in Settings -> Usage quotas.

This MR builds the "Usage by project" table.

Note: if you add up the data used by each project it might not match the total data used. This may be an API bug. I asked about it in !113392 (comment 1337457742)

Screenshots or screen recordings

Loading

Desktop Mobile
Screenshot_2023-03-29_at_9.41.22_AM Screenshot_2023-03-29_at_9.41.02_AM

Success

Desktop Mobile
Screenshot_2023-03-29_at_2.19.02_PM Screenshot_2023-03-29_at_2.19.16_PM

With pagination

Desktop Mobile
Screenshot_2023-03-28_at_2.56.43_PM Screenshot_2023-03-28_at_2.57.08_PM

Error

Screenshot_2023-03-28_at_1.44.28_PM

How to set up and validate locally

  1. Enable the data_transfer_monitoring feature flag
    • bin/rails console
    • Feature.enable(:data_transfer_monitoring)
  2. Seed the data
    • Open the console bin/rails console
    • Go to https://gitlab.com/-/snippets/2522604
    • Copy the class and paste it in the console
    • Find a group with some projects in it and make note of the group id (displayed on the overview page)
    • Run PopulateDataTransfer.run(<group_id>) in the console
    • Press q then type exit to get back to the normal command prompt
  3. Navigate to a top level group -> Settings -> Usage quotas
  4. Click on the Transfer tab

Testing pagination

Change app/assets/javascripts/api.js#L6 to 2.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Hegman

Merge request reports