Commit 0ba651e5 authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'docs-rails-snippet-summarize-artifact-sizes' into 'master'

Rails Cheatsheet: Add check of artifact storage space

See merge request gitlab-org/gitlab!63636
parents 508bc9af 7ace90da
......@@ -317,7 +317,18 @@ the displayed size may still show old sizes or commit numbers. To force an updat
p = Project.find_by_full_path('<namespace>/<project>')
pp p.statistics
p.statistics.refresh!
pp p.statistics # compare with earlier values
pp p.statistics
# compare with earlier values
# check the total artifact storage space separately
builds_with_artifacts = p.builds.with_downloadable_artifacts.all
artifact_storage = 0
builds_with_artifacts.find_each do |build|
artifact_storage += build.artifacts_size
end
puts "#{artifact_storage} bytes"
```
### Identify deploy keys associated with blocked and non-member users
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment