Adds dependency_proxy_size to RootNamespaceStorageStatistics
What does this MR do and why?
Adds a new column to namespace_root_storage_statistics
table for dependency_proxy_size
which will be used to hold the total storage size of DependencyProxy
related storage (Blobs
and Manifests
) across all namespaces in the hierarchy.
We need this column to:
- be able to efficiently calculate and store the Dependency Proxy storage size at the root namespace level (sum of all
namespace_statistics.dependency_proxy_size
- to display storage usage to our customers.
Refs https://gitlab.com/gitlab-org/gitlab/-/issues/348172
Database details
bin/rails db:migrate
== 20220119144253 AddDependencyProxySizeToNamespaceRootStorageStatistics: migrating
-- add_column(:namespace_root_storage_statistics, :dependency_proxy_size, :bigint, {:default=>0, :null=>false})
-> 0.0066s
== 20220119144253 AddDependencyProxySizeToNamespaceRootStorageStatistics: migrated (0.0067s)
bin/rails db:rollback
== 20220119144253 AddDependencyProxySizeToNamespaceRootStorageStatistics: reverting
-- remove_column(:namespace_root_storage_statistics, :dependency_proxy_size, :bigint, {:default=>0, :null=>false})
-> 0.0041s
== 20220119144253 AddDependencyProxySizeToNamespaceRootStorageStatistics: reverted (0.0068s)
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 Vijay Hawoldar