summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-03-26 22:32:04 +0200
committerMatija Čupić <matteeyah@gmail.com>2018-03-26 22:32:04 +0200
commit8853e183a85421d156dadd647f700a7a1a985b55 (patch)
tree7720c78db6ce85e9becc7d5831e4205a5f4f64f7
parent4478103d99534344e929b62e8244e7b4dd4805bd (diff)
downloadgitlab-ce-8853e183a85421d156dadd647f700a7a1a985b55.tar.gz
Make cluster usage datapoints more specific
-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 e75297b1d99..645dcecfe70 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.where(provider_type: ::Clusters::Cluster.provider_types[:gcp]).count,
- clusters_platforms_user: ::Clusters::Cluster.where(provider_type: ::Clusters::Cluster.provider_types[:user]).count,
- clusters_applications_helm: ::Clusters::Applications::Helm.count,
- clusters_applications_ingress: ::Clusters::Applications::Ingress.count,
- clusters_applications_prometheus: ::Clusters::Applications::Prometheus.count,
- clusters_applications_runner: ::Clusters::Applications::Runner.count,
+ clusters_platforms_gke: ::Clusters::Cluster.where(provider_type: ::Clusters::Cluster.provider_types[:gcp]).enabled.select { |cluster| cluster.status == ::Clusters::Providers::Gcp.state_machines[:status].states[:created].value }.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,
in_review_folder: ::Environment.in_review_folder.count,
groups: Group.count,
issues: Issue.count,