Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2018-03-05 21:34:59 +0300
committerPawel Chojnacki <pawel@chojnacki.ws>2018-03-05 21:34:59 +0300
commit5ceec83a0154e513480a9bb08e252371bf7886c6 (patch)
tree9a193e295c56feb2c29ac042b59b14b1808715d1 /app/models/environment.rb
parent273e4142566a053e0628183fbf86ef7b94cb5a66 (diff)
Implemente Prometheus:AdapterService
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r--app/models/environment.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index baba023c92d..24d4f1d8761 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -1,6 +1,4 @@
class Environment < ActiveRecord::Base
- include PrometheusAdapterLocator
-
# Used to generate random suffixes for the slug
LETTERS = 'a'..'z'
NUMBERS = '0'..'9'
@@ -159,6 +157,10 @@ class Environment < ActiveRecord::Base
prometheus_adapter.query(:additional_metrics_environment, self) if has_metrics?
end
+ def prometheus_adapter
+ @prometheus_adapter ||= Prometheus::AdapterService.new(project, deployment_platform).prometheus_adapter
+ end
+
def slug
super.presence || generate_slug
end