Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-03-29 22:26:12 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-03-29 22:26:12 +0300
commit8c1cfcbc221cf4ca69831d2ba66befc933e05924 (patch)
treee36a4ee41e9d82119ded68b88dd19b743bc57eb1 /lib/gitlab/usage_data.rb
parent982e5436e1ef9b309f8ee3a205f1e168273386b3 (diff)
Use cluster scopes to deflate usage data implementation
Diffstat (limited to 'lib/gitlab/usage_data.rb')
-rw-r--r--lib/gitlab/usage_data.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index 6335b6bc585..989b64148ae 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -51,12 +51,12 @@ module Gitlab
clusters: ::Clusters::Cluster.count,
clusters_enabled: ::Clusters::Cluster.enabled.count,
clusters_disabled: ::Clusters::Cluster.disabled.count,
- clusters_platforms_gke: ::Clusters::Cluster.includes(:provider_gcp).where(provider_type: ::Clusters::Cluster.provider_types[:gcp], cluster_providers_gcp: { status: ::Clusters::Providers::Gcp.state_machines[:status].states[:created].value }).enabled.count,
- clusters_platforms_user: ::Clusters::Cluster.where(provider_type: ::Clusters::Cluster.provider_types[:user]).enabled.count,
- clusters_applications_helm: ::Clusters::Applications::Helm.where(status: ::Clusters::Applications::Helm.state_machines[:status].states[:installed].value).count,
- clusters_applications_ingress: ::Clusters::Applications::Ingress.where(status: ::Clusters::Applications::Ingress.state_machines[:status].states[:installed].value).count,
- clusters_applications_prometheus: ::Clusters::Applications::Prometheus.where(status: ::Clusters::Applications::Prometheus.state_machines[:status].states[:installed].value).count,
- clusters_applications_runner: ::Clusters::Applications::Runner.where(status: ::Clusters::Applications::Runner.state_machines[:status].states[:installed].value).count,
+ clusters_platforms_gke: ::Clusters::Cluster.includes(:provider_gcp).gcp_provided.where(cluster_providers_gcp: { status: ::Clusters::Providers::Gcp.state_machines[:status].states[:created].value }).enabled.count,
+ clusters_platforms_user: ::Clusters::Cluster.user_provided.enabled.count,
+ clusters_applications_helm: ::Clusters::Applications::Helm.installed.count,
+ clusters_applications_ingress: ::Clusters::Applications::Ingress.installed.count,
+ clusters_applications_prometheus: ::Clusters::Applications::Prometheus.installed.count,
+ clusters_applications_runner: ::Clusters::Applications::Runner.installed.count,
in_review_folder: ::Environment.in_review_folder.count,
groups: Group.count,
issues: Issue.count,