diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-04 11:51:51 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-04 12:19:23 +0200 |
commit | ce3d98f7498a3afdfaa57ae58305d9112aa7a731 (patch) | |
tree | e5b5a17104b8bd836b2b966d191deab86a1c5f01 /db/importers | |
parent | 5646f3f551fe133ff0726af00d435fab2509f1e5 (diff) | |
download | gitlab-ce-ce3d98f7498a3afdfaa57ae58305d9112aa7a731.tar.gz |
Fix static analysis
Diffstat (limited to 'db/importers')
-rw-r--r-- | db/importers/common_metrics_importer.rb | 10 |
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 |