diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-06-08 13:29:53 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-06-08 13:29:53 +0300 |
commit | f78fd3de5d55830c84f25cfd50d399e7ddaddf30 (patch) | |
tree | c03894b057000cc183a8e0b6b38642cc7325a00d /lib | |
parent | 6eb96b2019d392d906a64108dbe83b3ce7cce758 (diff) |
Fix Additional metrics filtering
+ remove test button that was leftover after a bad merge
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/prometheus/additional_metrics_parser.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/prometheus/metric_group.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/prometheus/queries/query_additional_metrics.rb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/prometheus/additional_metrics_parser.rb b/lib/gitlab/prometheus/additional_metrics_parser.rb index 18eb79a44be..694001605ef 100644 --- a/lib/gitlab/prometheus/additional_metrics_parser.rb +++ b/lib/gitlab/prometheus/additional_metrics_parser.rb @@ -4,7 +4,7 @@ module Gitlab extend self def load_groups_from_yaml - additional_metrics_raw.map(&method(:new)) + additional_metrics_raw.map(&method(:group_from_entry)) end private @@ -25,7 +25,7 @@ module Gitlab raise ParsingError.new("entry missing required fields #{missing_fields}") unless missing_fields.empty? group = MetricGroup.new(entry[:group], entry[:priority]) - group.tap { |g| g.metrics = Metric.metrics_from_list(entry[:metrics]) } + group.tap { |g| g.metrics = metrics_from_list(entry[:metrics]) } end def additional_metrics_raw diff --git a/lib/gitlab/prometheus/metric_group.rb b/lib/gitlab/prometheus/metric_group.rb index c3b24dc1fa5..12bdf407ce0 100644 --- a/lib/gitlab/prometheus/metric_group.rb +++ b/lib/gitlab/prometheus/metric_group.rb @@ -4,7 +4,7 @@ module Gitlab attr_reader :priority, :name attr_accessor :metrics - def initialize(name:, priority:, metrics: []) + def initialize(name, priority, metrics = []) @name = name @priority = priority @metrics = metrics diff --git a/lib/gitlab/prometheus/queries/query_additional_metrics.rb b/lib/gitlab/prometheus/queries/query_additional_metrics.rb index dd888b2bc1d..a5a401f84cd 100644 --- a/lib/gitlab/prometheus/queries/query_additional_metrics.rb +++ b/lib/gitlab/prometheus/queries/query_additional_metrics.rb @@ -37,7 +37,7 @@ module Gitlab def query_with_result(query) query[:result]&.any? do |item| - item&.[](:values)&.any? || item&.[](:value)&.any? + item&.[]('values')&.any? || item&.[]('value')&.any? end end |