Commit Graph

20 Commits

Author SHA1 Message Date
Ash McKenzie 19ff9d9899
Replace rails_helper.rb with spec_helper.rb
rails_helper.rb's only logic was to require
spec_helper.rb.
2019-08-30 12:26:18 +10:00
Mayra Cabrera c6acb77d8a Removes update_statistics_namespace feature flag
After measuring the impact of the namespace storage on
https://gitlab.com/gitlab-org/gitlab-ce/issues/64092. It was decided
that it's performant enough. So we can freely remove the feature flag

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/64092
2019-08-02 09:29:29 -05:00
Mayra Cabrera ec39a1d63d Schedule namespace aggregation in other contexts
Schedules a Namespace::AggregationSchedule worker if some of the project
statistics are refreshed.

The worker is only executed if the feature flag is enabled.
2019-07-08 15:06:05 +00:00
Alessio Caiazza c699c6fe3c Fix nil coercion updating storage size on project statistics 2019-06-10 15:44:50 +00:00
Alessio Caiazza 83a8b77961 Add Namespace and ProjectStatistics to GraphQL API
We can query namespaces, and nested projects.

Projects now exposes statistics
2019-06-03 12:01:32 +02:00
Peter Marko 8a0226d4be Add spec to verify statistics without repositories 2019-05-29 16:15:02 +02:00
Peter Marko 40490cc492 Add wiki size to project statistics 2019-05-29 16:08:25 +02:00
Alessio Caiazza d9b383cc36 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.
2019-05-02 16:04:15 +00:00
Thong Kuah a2cfc150ce Add # frozen_string_literal to spec/models
Adds `# frozen_string_literal: true` to spec/models ruby files
2019-04-01 14:37:54 +13:00
Peter Marko 5e01ee78e5 Update total storage size when changing size of artifacts 2018-07-27 17:21:41 +02:00
Dylan Griffith 03b020f2e4 Update ProjectStatistics#build_artifacts_size synchronously without summing (#41059)
Previously we scheduled a worker to just some this but we were running
into performance issues when the build table was getting too large. So
now we've updated the code such that this column is updated immediately
and incremented/decremented by the correct amount whenever artifacts are
created or deleted.

We've also added the performance optimization that we do not update this
statistic if a project is deleted because it could result in many
updates for a project with many builds.
2018-04-19 18:35:40 +10:00
Nick Thomas 22aef3d424
Fix a bug calculating artifact size for project statistics 2018-01-18 17:48:09 +00:00
Zeger-Jan van de Weg bf6126b1ec Add coverage on legacy artifacts for Ci::Build 2017-12-03 12:04:49 +01:00
Kamil Trzcinski 38c61ab6df Fix specs failures, and use factory with `:ci_job_artifact, :archive` 2017-12-03 12:04:49 +01:00
Zeger-Jan van de Weg 61864a5a5b Rename Artifact to JobArtifact, split metadata out
Two things at ones, as there was no clean way to seperate the commit and
give me feedback from the tests.

But the model Artifact is now JobArtifact, and the table does not have a
type anymore, but the metadata is now its own model:
Ci::JobArtifactMetadata.
2017-12-03 12:04:48 +01:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Rémy Coutable 3db37e0562 Enable the Style/TrailingCommaInArguments cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Oswaldo Ferreira 4bb3675b7d Fix Project#update_repository_size to convert MB to Bytes properly 2017-01-17 21:50:09 -02:00
Markus Koller 3ef4f74b1a
Add more storage statistics
This adds counters for build artifacts and LFS objects, and moves
the preexisting repository_size and commit_count from the projects
table into a new project_statistics table.

The counters are displayed in the administration area for projects
and groups, and also available through the API for admins (on */all)
and normal users (on */owned)

The statistics are updated through ProjectCacheWorker, which can now
do more granular updates with the new :statistics argument.
2016-12-21 16:39:49 +01:00