summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-07-25 16:31:53 +1200
committerThong Kuah <tkuah@gitlab.com>2019-07-25 16:46:20 +1200
commit41f87e9e99e14f7d591f222b0246467acd040625 (patch)
tree3c890316bb7a0f8755831ecfb8d94d2282c900ef /app
parent7fa0c7662b88efa72d29087a273f0b6c1e484b3e (diff)
downloadgitlab-ce-41f87e9e99e14f7d591f222b0246467acd040625.tar.gz
Removes potentially incorrect, and slow fallbackremove_deployment_metrics_deployment_platform_fallback
Deployment_platform is relatively expensive and calling this after the fact means that this may not be the cluster that was deployed to. Correspondingly reduce the leeway given in the related N+1 spec
Diffstat (limited to 'app')
-rw-r--r--app/models/deployment_metrics.rb13
1 files changed, 1 insertions, 12 deletions
diff --git a/app/models/deployment_metrics.rb b/app/models/deployment_metrics.rb
index cfe762ca25e..2056c8bc59c 100644
--- a/app/models/deployment_metrics.rb
+++ b/app/models/deployment_metrics.rb
@@ -44,18 +44,7 @@ class DeploymentMetrics
end
end
- # TODO remove fallback case to deployment_platform_cluster.
- # Otherwise we will continue to pay the performance penalty described in
- # https://gitlab.com/gitlab-org/gitlab-ce/issues/63475
- #
- # Removal issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/64105
def cluster_prometheus
- cluster_with_fallback = cluster || deployment_platform_cluster
-
- cluster_with_fallback.application_prometheus if cluster_with_fallback&.application_prometheus_available?
- end
-
- def deployment_platform_cluster
- deployment.environment.deployment_platform&.cluster
+ cluster.application_prometheus if cluster&.application_prometheus_available?
end
end