summaryrefslogtreecommitdiff
path: root/app/models/deployment.rb
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-06-16 20:48:34 +0200
committerPawel Chojnacki <pawel@chojnacki.ws>2017-06-16 20:48:34 +0200
commit6e4d5334211d73dd731cb8757b2ef10e8ea428b7 (patch)
treef48f5b8582bd9ff93b8e58182cd5018eda6a82f4 /app/models/deployment.rb
parentbe5f665557fc4f5b10d34f407545486746af54b8 (diff)
downloadgitlab-ce-6e4d5334211d73dd731cb8757b2ef10e8ea428b7.tar.gz
Move Prometheus service to project model
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r--app/models/deployment.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index 04d08f2cfd5..00bf0c118ae 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -114,17 +114,17 @@ class Deployment < ActiveRecord::Base
project.monitoring_service.deployment_metrics(self)
end
+ def has_additional_metrics?
+ project.prometheus_service.present?
+ end
+
def additional_metrics
- return {} unless prometheus_service.present?
+ return {} unless project.prometheus_service.present?
- metrics = prometheus_service.additional_deployment_metrics(self)
+ metrics = project.prometheus_service.additional_deployment_metrics(self)
metrics&.merge(deployment_time: created_at.to_i) || {}
end
- def prometheus_service
- @prometheus_service ||= project.monitoring_services.reorder(nil).find_by(active: true, type: PrometheusService.name)
- end
-
private
def ref_path