diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2019-05-02 16:04:15 +0000 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2019-05-02 16:04:15 +0000 |
commit | d9b383cc3681c4ae6fe0dbef20a3d1089e48e139 (patch) | |
tree | 8c1a00a07faa120c6fbaacc389fa9266cdf306db /app/helpers/storage_helper.rb | |
parent | 37606e666736c9686054ee5155e3d2d21eb1a0c9 (diff) | |
download | gitlab-ce-d9b383cc3681c4ae6fe0dbef20a3d1089e48e139.tar.gz |
Add packages_size to ProjectStatistics
This new field will allow to keep track of the storage used by the
packages features, it provides also aggregation at namespace level.
Diffstat (limited to 'app/helpers/storage_helper.rb')
-rw-r--r-- | app/helpers/storage_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/storage_helper.rb b/app/helpers/storage_helper.rb index be8761db562..15041bd5805 100644 --- a/app/helpers/storage_helper.rb +++ b/app/helpers/storage_helper.rb @@ -6,4 +6,14 @@ module StorageHelper number_to_human_size(size_in_bytes, delimiter: ',', precision: precision, significant: false) end + + def storage_counters_details(statistics) + counters = { + counter_repositories: storage_counter(statistics.repository_size), + counter_build_artifacts: storage_counter(statistics.build_artifacts_size), + counter_lfs_objects: storage_counter(statistics.lfs_objects_size) + } + + _("%{counter_repositories} repositories, %{counter_build_artifacts} build artifacts, %{counter_lfs_objects} LFS") % counters + end end |