Add more storage statistics
What does this MR do?
Display more information about used storage:
display total repository size for groups (
- include build artifacts
- include LFS objects
- expose counters in API
- update counters when creating/destroying LFS objects
- update counters when creating/destroying CI builds
handle shared LFS objects(ignored for now, see this comment)
.badgestyle after https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7873 is merged
Are there points in the code the reviewer needs to double check?
Answered in comment below:
- Not sure if
ProjectCacheWorkeris the most appropriate place to update the namespace cache, or if I should add a
- Not sure yet how I should display the other object types, it probably makes sense to store them in dedicated columns, but display a total in most places in the interface
Why was this MR needed?
- Currently the storage information is only displayed per project, making it inconvenient to find out how much storage a whole group is using
- The storage information is only for the bare Git repository, other things like builds and uploads are not included
Admin group overview, displays total storage:
Admin project overview, displays total storage:
Admin group detail, displays total and individual counters:
Admin project detail, displays total and individual counters:
User project view, displays repository size + LFS objects:
Does this MR meet the acceptance criteria?
- Changelog entry added
- Documentation created/updated
- API support added
- Added for this feature/bug
- All builds are passing
- Conform by the merge request performance guides
- Conform by the style guides
Branch has no merge conflicts with
master(if it does - rebase it please)
- Squashed related commits together
What are the relevant issue numbers?
Info: Updating storage counters after update
The new storage counters will be updated when necessary, to force an update for specific columns run the following in
ProjectStatistics.includes(:project).find_each(batch_size: 100) do |stats| stats.refresh! only: [:build_artifacts_size, :lfs_objects_size] end