diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-04-26 22:09:03 +0200 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-05-11 23:07:12 +0200 |
commit | 4f824d2aecf4fec46febd767fa7f7d747c732112 (patch) | |
tree | 09b0b6458b7ec4fc414431f1d323b01bb68265ef /app/models/deployment.rb | |
parent | e7b53dd67815a306dfb57cb7545d06391bc12aa7 (diff) | |
download | gitlab-ce-4f824d2aecf4fec46febd767fa7f7d747c732112.tar.gz |
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.rb | 8 |
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 |