summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2018-01-04 17:11:39 +0100
committerPawel Chojnacki <pawel@chojnacki.ws>2018-01-04 17:11:39 +0100
commit57c1f7cae09fe60a4be8d99b64833779476f402d (patch)
treebdf2ac73f3df83f06e96ec54d5c60a5797959fbd /app
parent09473b192c70ada66148dace8c6196ccabfa1dd9 (diff)
downloadgitlab-ce-57c1f7cae09fe60a4be8d99b64833779476f402d.tar.gz
Fix rubocop warnings
Diffstat (limited to 'app')
-rw-r--r--app/models/project_services/prometheus_service.rb9
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