Commit 87446fd1 authored by Krasimir Angelov's avatar Krasimir Angelov

Merge branch 'vij-container-reg-stats-1' into 'master'

Adds container_registry_size to project_statistics

See merge request gitlab-org/gitlab!84271
parents 68666e8d f50dcb09
# frozen_string_literal: true
class AddContainerRegistrySizeToProjectStatistics < Gitlab::Database::Migration[1.0]
enable_lock_retries!
def change
add_column :project_statistics, :container_registry_size, :bigint, default: 0, null: false
end
end
6da0e999ab7bed0f9ee7a7938c9fa9ce4619d554640aa2d387f90e42d880db30
\ No newline at end of file
......@@ -19410,7 +19410,8 @@ CREATE TABLE project_statistics (
wiki_size bigint,
snippets_size bigint,
pipeline_artifacts_size bigint DEFAULT 0 NOT NULL,
uploads_size bigint DEFAULT 0 NOT NULL
uploads_size bigint DEFAULT 0 NOT NULL,
container_registry_size bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE project_statistics_id_seq
......@@ -24,6 +24,7 @@ FactoryBot.define do
project_statistics.snippets_size = evaluator.size_multiplier * 6
project_statistics.pipeline_artifacts_size = evaluator.size_multiplier * 7
project_statistics.uploads_size = evaluator.size_multiplier * 8
project_statistics.container_registry_size = evaluator.size_multiplier * 9
end
end
end
......
......@@ -35,7 +35,8 @@ RSpec.describe ProjectStatistics do
build_artifacts_size: 1.exabyte,
snippets_size: 1.exabyte,
pipeline_artifacts_size: 512.petabytes - 1,
uploads_size: 512.petabytes
uploads_size: 512.petabytes,
container_registry_size: 8.exabytes - 1
)
statistics.reload
......@@ -49,6 +50,7 @@ RSpec.describe ProjectStatistics do
expect(statistics.snippets_size).to eq(1.exabyte)
expect(statistics.pipeline_artifacts_size).to eq(512.petabytes - 1)
expect(statistics.uploads_size).to eq(512.petabytes)
expect(statistics.container_registry_size).to eq(8.exabytes - 1)
end
end
......
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