diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2018-01-04 19:11:39 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2018-01-04 19:11:39 +0300 |
commit | 57c1f7cae09fe60a4be8d99b64833779476f402d (patch) | |
tree | bdf2ac73f3df83f06e96ec54d5c60a5797959fbd /app/models/project_services | |
parent | 09473b192c70ada66148dace8c6196ccabfa1dd9 (diff) |
Fix rubocop warnings
Diffstat (limited to 'app/models/project_services')
-rw-r--r-- | app/models/project_services/prometheus_service.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/project_services/prometheus_service.rb b/app/models/project_services/prometheus_service.rb index 8bb1eb28900..3bf44c1ab2b 100644 --- a/app/models/project_services/prometheus_service.rb +++ b/app/models/project_services/prometheus_service.rb @@ -23,7 +23,7 @@ class PrometheusService < MonitoringService def initialize_properties if properties.nil? - self.properties = { } + self.properties = {} end end @@ -45,7 +45,8 @@ class PrometheusService < MonitoringService def fields [ - { type: 'fieldset', + { + type: 'fieldset', legend: 'Manual Configuration', fields: [ { @@ -100,6 +101,7 @@ class PrometheusService < MonitoringService # Cache metrics for specific environment def calculate_reactive_cache(query_class_name, environment_id, *args) return unless active? && project && !project.pending_delete? + client = client(environment_id) data = Kernel.const_get(query_class_name).new(client).query(environment_id, *args) @@ -118,9 +120,10 @@ class PrometheusService < MonitoringService else cluster = cluster_with_prometheus(environment_id) raise Gitlab::PrometheusError, "couldn't find cluster with Prometheus installed" unless cluster - rest_client = client_from_cluster(cluster) + rest_client = client_from_cluster(cluster) raise Gitlab::PrometheusError, "couldn't create proxy Prometheus client" unless rest_client + Gitlab::PrometheusClient.new(rest_client) end end |