Commit 8c1cfcbc authored by Matija Čupić's avatar Matija Čupić

Use cluster scopes to deflate usage data implementation

parent 982e5436
...@@ -51,12 +51,12 @@ module Gitlab ...@@ -51,12 +51,12 @@ module Gitlab
clusters: ::Clusters::Cluster.count, clusters: ::Clusters::Cluster.count,
clusters_enabled: ::Clusters::Cluster.enabled.count, clusters_enabled: ::Clusters::Cluster.enabled.count,
clusters_disabled: ::Clusters::Cluster.disabled.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_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.where(provider_type: ::Clusters::Cluster.provider_types[:user]).enabled.count, clusters_platforms_user: ::Clusters::Cluster.user_provided.enabled.count,
clusters_applications_helm: ::Clusters::Applications::Helm.where(status: ::Clusters::Applications::Helm.state_machines[:status].states[:installed].value).count, clusters_applications_helm: ::Clusters::Applications::Helm.installed.count,
clusters_applications_ingress: ::Clusters::Applications::Ingress.where(status: ::Clusters::Applications::Ingress.state_machines[:status].states[:installed].value).count, clusters_applications_ingress: ::Clusters::Applications::Ingress.installed.count,
clusters_applications_prometheus: ::Clusters::Applications::Prometheus.where(status: ::Clusters::Applications::Prometheus.state_machines[:status].states[:installed].value).count, clusters_applications_prometheus: ::Clusters::Applications::Prometheus.installed.count,
clusters_applications_runner: ::Clusters::Applications::Runner.where(status: ::Clusters::Applications::Runner.state_machines[:status].states[:installed].value).count, clusters_applications_runner: ::Clusters::Applications::Runner.installed.count,
in_review_folder: ::Environment.in_review_folder.count, in_review_folder: ::Environment.in_review_folder.count,
groups: Group.count, groups: Group.count,
issues: Issue.count, issues: Issue.count,
......
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