summaryrefslogtreecommitdiff
path: root/app/models/deployment.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r--app/models/deployment.rb32
1 files changed, 0 insertions, 32 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index 3b31e7b1333..ad32ec3f1d5 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -176,40 +176,8 @@ class Deployment < ApplicationRecord
deployed_at&.to_time&.in_time_zone&.to_s(:medium)
end
- def has_metrics?
- success? && prometheus_adapter&.can_query?
- end
-
- def metrics
- return {} unless has_metrics?
-
- metrics = prometheus_adapter.query(:deployment, self)
- metrics&.merge(deployment_time: finished_at.to_i) || {}
- end
-
- def additional_metrics
- return {} unless has_metrics?
-
- metrics = prometheus_adapter.query(:additional_metrics_deployment, self)
- metrics&.merge(deployment_time: finished_at.to_i) || {}
- end
-
private
- def prometheus_adapter
- service = project.find_or_initialize_service('prometheus')
-
- if service.can_query?
- service
- else
- cluster_prometheus
- end
- end
-
- def cluster_prometheus
- cluster.application_prometheus if cluster&.application_prometheus_available?
- end
-
def ref_path
File.join(environment.ref_path, 'deployments', iid.to_s)
end