Skip to content

Add storage usage export

Vijay Hawoldar requested to merge vij-export-namespace-stats-service into master

What does this MR do and why?

Adds a service for generating a storage statistics usage export for a given plan.

To support exporting namespace storage statistics usage as a CSV, this a service to generate the CSV with a custom iterator so that we can avoid the CsvBuilder's iterator, which causes a slow query due to the order hint. (See this thread for more info)

Initially this will only support the free plan, but will eventually be expanded for others (i.e. premium/ultimate).

To reduce the size of the diff, I've split out the associated worker/controller for exporting the CSV into !133209 (merged)

Refs https://gitlab.com/gitlab-org/gitlab/-/issues/422501

Queries

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Visit http://gdk.test:3000/admin/namespace_limits/export.csv

Numbered steps to set up and validate the change are strongly suggested.

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 Vijay Hawoldar

Merge request reports