diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-06-05 22:00:57 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-06-05 22:00:57 +0300 |
commit | 1b6ab2dffce29df53f57cd857720b9f77ab4a7ca (patch) | |
tree | 157788a60b5ba0fb87870e5fca6ac808535d4364 /lib | |
parent | ffedc52eaa33a7a31d3a7b4893387e81163a3d5f (diff) |
Remove orig file + rubocop cleanup
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/prometheus/queries/additional_metrics_deployment_query.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/prometheus/queries/additional_metrics_query.rb | 5 | ||||
-rw-r--r-- | lib/gitlab/prometheus_client.rb | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/lib/gitlab/prometheus/queries/additional_metrics_deployment_query.rb b/lib/gitlab/prometheus/queries/additional_metrics_deployment_query.rb index 382052c298f..7693772bf81 100644 --- a/lib/gitlab/prometheus/queries/additional_metrics_deployment_query.rb +++ b/lib/gitlab/prometheus/queries/additional_metrics_deployment_query.rb @@ -1,6 +1,5 @@ module Gitlab::Prometheus::Queries class AdditionalMetricsDeploymentQuery < AdditionalMetricsQuery - def query(deployment_id) deployment = Deployment.find_by(id: deployment_id) query_context = { @@ -14,4 +13,3 @@ module Gitlab::Prometheus::Queries end end end - diff --git a/lib/gitlab/prometheus/queries/additional_metrics_query.rb b/lib/gitlab/prometheus/queries/additional_metrics_query.rb index d21a3978e25..7ef4ee3a91a 100644 --- a/lib/gitlab/prometheus/queries/additional_metrics_query.rb +++ b/lib/gitlab/prometheus/queries/additional_metrics_query.rb @@ -40,11 +40,11 @@ module Gitlab::Prometheus::Queries private def metric_with_any_queries(metric) - metric[:queries]&.count > 0 + metric[:queries]&.count&.> 0 end def group_with_any_metrics(group) - group[:metrics]&.count > 0 + group[:metrics]&.count&.> 0 end def query_with_result(query) @@ -64,7 +64,6 @@ module Gitlab::Prometheus::Queries query_with_result end - def available_metrics @available_metrics ||= client_label_values || [] end diff --git a/lib/gitlab/prometheus_client.rb b/lib/gitlab/prometheus_client.rb index f4ef4ff8ba4..aa94614bf18 100644 --- a/lib/gitlab/prometheus_client.rb +++ b/lib/gitlab/prometheus_client.rb @@ -29,7 +29,7 @@ module Gitlab end end - def label_values(name='__name__') + def label_values(name = '__name__') json_api_get("label/#{name}/values") end |