Add product analytics usage table for each projects usage within the group
Proposal
As part of Product Analytics Usage Quota MVC Implementatio... (#419407 - closed) we need to create a new table to show to each project's usage within the group. The table should show the raw numbers for each project's usage for the previous and current billing period.
Furthermore, we need to also update the documentation to note the new table.
Designs
frontend
Implementation plan –Note: Builds on previous app structure issue
- Add Apollo client to app + setup query
- We will need to query two sets of data unfortunately, once for the current month, once for the previous month
- Query will fetch all names + usage counts for projects within the current group, e.g.:
sample query
query {
previous: group(fullPath: "gitlab-instance-c8b17bf8") {
projects {
nodes {
name
productAnalyticsEventsStored(year: 2023, month: 9)
}
}
}
current: group(fullPath: "gitlab-instance-c8b17bf8") {
projects {
nodes {
name
productAnalyticsEventsStored(year: 2023, month: 10)
}
}
}
}
- filter out any projects not using product analytics, e.g. where
"productAnalyticsEventsStored": null,
- combine query results together so each project has two sets of counts
- create component for usage table, rendered from the main app component
- render project name + count + count for the current + previous months in a
gl-table-lite
- include info icon tooltip in column header specifying that counts are updated hourly
- include message similar to other usage quota pages
This table omits projects that are not using product analytics
- render project name + count + count for the current + previous months in a
- add error / loading / empty states (empty as in no projects with onboarded product analytics are returned - when project is onboarded but has no events this will display as
0
) - tests
Future iterations/ideas not for this version
- Include any limits/purchased quota if applicable
- Include a progress bar towards said limits/quota
- Pagination can be a future concern, we don't anticipate any groups having more than 50 projects at release
Edited by Elwyn Benson