Add `Usage by project` table to group data transfer dashboard
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 |
---|---|
Success
Desktop | Mobile |
---|---|
With pagination
Desktop | Mobile |
---|---|
Error
How to set up and validate locally
- Enable the
data_transfer_monitoring
feature flagbin/rails console
Feature.enable(:data_transfer_monitoring)
- 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 typeexit
to get back to the normal command prompt
- Open the console
- Navigate to a top level group ->
Settings
->Usage quotas
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Peter Hegman