Commit 999c81c7 authored by Markus Koller's avatar Markus Koller

Merge branch 'fj-223707-add-snippets-size-to-usage-data-views' into 'master'

Updated storage views to include snippets_size

See merge request gitlab-org/gitlab!35419
parents af74f78a 5d9d74ea
...@@ -14,9 +14,10 @@ module StorageHelper ...@@ -14,9 +14,10 @@ module StorageHelper
counter_repositories: storage_counter(statistics.repository_size), counter_repositories: storage_counter(statistics.repository_size),
counter_wikis: storage_counter(statistics.wiki_size), counter_wikis: storage_counter(statistics.wiki_size),
counter_build_artifacts: storage_counter(statistics.build_artifacts_size), counter_build_artifacts: storage_counter(statistics.build_artifacts_size),
counter_lfs_objects: storage_counter(statistics.lfs_objects_size) counter_lfs_objects: storage_counter(statistics.lfs_objects_size),
counter_snippets: storage_counter(statistics.snippets_size)
} }
_("Repository: %{counter_repositories} / Wikis: %{counter_wikis} / Build Artifacts: %{counter_build_artifacts} / LFS: %{counter_lfs_objects}") % counters _("Repository: %{counter_repositories} / Wikis: %{counter_wikis} / Build Artifacts: %{counter_build_artifacts} / LFS: %{counter_lfs_objects} / Snippets: %{counter_snippets}") % counters
end end
end end
...@@ -78,6 +78,7 @@ export default { ...@@ -78,6 +78,7 @@ export default {
buildArtifactsSize: s__('UsageQuota|Artifacts'), buildArtifactsSize: s__('UsageQuota|Artifacts'),
packagesSize: s__('UsageQuota|Packages'), packagesSize: s__('UsageQuota|Packages'),
wikiSize: s__('UsageQuota|Wiki'), wikiSize: s__('UsageQuota|Wiki'),
snippetsSize: s__('UsageQuota|Snippets'),
}, },
}; };
</script> </script>
......
...@@ -27,6 +27,7 @@ query getStorageCounter($fullPath: ID!) { ...@@ -27,6 +27,7 @@ query getStorageCounter($fullPath: ID!) {
buildArtifactsSize buildArtifactsSize
packagesSize packagesSize
wikiSize wikiSize
snippetsSize
} }
} }
} }
......
---
title: Update storage views to show snippets size
merge_request: 35419
author:
type: changed
...@@ -19,6 +19,8 @@ const data = { ...@@ -19,6 +19,8 @@ const data = {
lfsObjectsSize: 0, lfsObjectsSize: 0,
buildArtifactsSize: 1272375, buildArtifactsSize: 1272375,
packagesSize: 0, packagesSize: 0,
wikiSize: 2048,
snippetsSize: 1024,
}, },
}; };
......
...@@ -19228,7 +19228,7 @@ msgstr "" ...@@ -19228,7 +19228,7 @@ msgstr ""
msgid "Repository sync capacity" msgid "Repository sync capacity"
msgstr "" msgstr ""
msgid "Repository: %{counter_repositories} / Wikis: %{counter_wikis} / Build Artifacts: %{counter_build_artifacts} / LFS: %{counter_lfs_objects}" msgid "Repository: %{counter_repositories} / Wikis: %{counter_wikis} / Build Artifacts: %{counter_build_artifacts} / LFS: %{counter_lfs_objects} / Snippets: %{counter_snippets}"
msgstr "" msgstr ""
msgid "RepositorySettingsAccessLevel|Select" msgid "RepositorySettingsAccessLevel|Select"
...@@ -24734,6 +24734,9 @@ msgstr "" ...@@ -24734,6 +24734,9 @@ msgstr ""
msgid "UsageQuota|Repository" msgid "UsageQuota|Repository"
msgstr "" msgstr ""
msgid "UsageQuota|Snippets"
msgstr ""
msgid "UsageQuota|Storage" msgid "UsageQuota|Storage"
msgstr "" msgstr ""
......
...@@ -15,7 +15,7 @@ RSpec.describe "Admin > Admin sees project statistics" do ...@@ -15,7 +15,7 @@ RSpec.describe "Admin > Admin sees project statistics" do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
it "shows project statistics" do it "shows project statistics" do
expect(page).to have_content("Storage: 0 Bytes (Repository: 0 Bytes / Wikis: 0 Bytes / Build Artifacts: 0 Bytes / LFS: 0 Bytes)") expect(page).to have_content("Storage: 0 Bytes (Repository: 0 Bytes / Wikis: 0 Bytes / Build Artifacts: 0 Bytes / LFS: 0 Bytes / Snippets: 0 Bytes)")
end end
end end
......
...@@ -30,10 +30,11 @@ RSpec.describe StorageHelper do ...@@ -30,10 +30,11 @@ RSpec.describe StorageHelper do
repository_size: 10.kilobytes, repository_size: 10.kilobytes,
wiki_size: 10.bytes, wiki_size: 10.bytes,
lfs_objects_size: 20.gigabytes, lfs_objects_size: 20.gigabytes,
build_artifacts_size: 30.megabytes)) build_artifacts_size: 30.megabytes,
snippets_size: 40.megabytes))
end end
let(:message) { 'Repository: 10 KB / Wikis: 10 Bytes / Build Artifacts: 30 MB / LFS: 20 GB' } let(:message) { 'Repository: 10 KB / Wikis: 10 Bytes / Build Artifacts: 30 MB / LFS: 20 GB / Snippets: 40 MB' }
it 'works on ProjectStatistics' do it 'works on ProjectStatistics' do
expect(helper.storage_counters_details(project.statistics)).to eq(message) expect(helper.storage_counters_details(project.statistics)).to eq(message)
......
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