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>2017-04-26 23:09:03 +0300
committerPawel Chojnacki <pawel@chojnacki.ws>2017-05-12 00:07:12 +0300
commit4f824d2aecf4fec46febd767fa7f7d747c732112 (patch)
tree09b0b6458b7ec4fc414431f1d323b01bb68265ef /app/models/deployment.rb
parente7b53dd67815a306dfb57cb7545d06391bc12aa7 (diff)
Custom queries for prometheus
- Tests for prometheus queries - fix rubocop warnings - Remove unused method. Add more queries to deployment queries. - Wrap BaseQuery in module hierarchy Renname Prometheus class to PrometheusClient
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r--app/models/deployment.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index f83d9e8edee..f4751dc5334 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -103,14 +103,10 @@ class Deployment < ActiveRecord::Base
project.monitoring_service.present?
end
- def metrics(timeframe)
+ def metrics
return {} unless has_metrics?
- half_timeframe = timeframe / 2
- timeframe_start = created_at - half_timeframe
- timeframe_end = created_at + half_timeframe
-
- metrics = project.monitoring_service.metrics(environment, timeframe_start: timeframe_start, timeframe_end: timeframe_end)
+ metrics = project.monitoring_service.deployment_metrics(self)
metrics&.merge(deployment_time: created_at.to_i) || {}
end