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
path: root/db
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-09-04 12:51:51 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2018-09-04 13:19:23 +0300
commitce3d98f7498a3afdfaa57ae58305d9112aa7a731 (patch)
treee5b5a17104b8bd836b2b966d191deab86a1c5f01 /db
parent5646f3f551fe133ff0726af00d435fab2509f1e5 (diff)
Fix static analysis
Diffstat (limited to 'db')
-rw-r--r--db/importers/common_metrics_importer.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/db/importers/common_metrics_importer.rb b/db/importers/common_metrics_importer.rb
index 9e6d2dd0518..3a150e8fc5f 100644
--- a/db/importers/common_metrics_importer.rb
+++ b/db/importers/common_metrics_importer.rb
@@ -9,11 +9,11 @@ module Importers
aws_elb: -3,
nginx: -4,
kubernetes: -5,
-
+
# custom groups
business: 0,
response: 1,
- system: 2,
+ system: 2
}
scope :common, -> { where(common: true) }
@@ -38,7 +38,7 @@ module Importers
def initialize(file = 'config/prometheus/common_metrics.yml')
@content = YAML.load_file(file)
end
-
+
def execute
process_content do |id, attributes|
find_or_build_metric!(id)
@@ -80,12 +80,12 @@ module Importers
query: query['query_range'],
unit: query['unit'])
- blk.call(query['id'], attributes)
+ yield(query['id'], attributes)
end
def find_or_build_metric!(id)
raise MissingQueryId unless id
-
+
PrometheusMetric.common.find_by(identifier: id) ||
PrometheusMetric.new(common: true, identifier: id)
end