diff options
author | Maxim Rydkin <maks.rydkin@gmail.com> | 2017-08-24 20:16:31 +0300 |
---|---|---|
committer | Maxim Rydkin <maks.rydkin@gmail.com> | 2017-08-29 11:14:42 +0300 |
commit | e6c7c11a5bb2656c2be997368b62aca61bb1f485 (patch) | |
tree | 10814c529cf68f88c1fcb9b974c82279196e6de4 | |
parent | eb0a17ba4bf05b7bcefb31755381d08fd689b818 (diff) | |
download | gitlab-ce-e6c7c11a5bb2656c2be997368b62aca61bb1f485.tar.gz |
replace `has_matching_label` with `has_matching_label?`
-rw-r--r-- | .rubocop_todo.yml | 3 | ||||
-rw-r--r-- | lib/gitlab/prometheus/queries/matched_metrics_query.rb | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4141d221039..f51228180c8 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -244,8 +244,11 @@ Style/PerlBackrefs: # NameWhitelist: is_a? Style/PredicateName: Enabled: true + Exclude: + - 'features/*' # NamePrefix: is_ NamePrefixBlacklist: is_ + NameWhitelist: has_n_stars # Offense count: 58 # Cop supports --auto-correct. diff --git a/lib/gitlab/prometheus/queries/matched_metrics_query.rb b/lib/gitlab/prometheus/queries/matched_metrics_query.rb index d4894c87f8d..4c3edccc71a 100644 --- a/lib/gitlab/prometheus/queries/matched_metrics_query.rb +++ b/lib/gitlab/prometheus/queries/matched_metrics_query.rb @@ -42,13 +42,13 @@ module Gitlab lookup = series.each_slice(MAX_QUERY_ITEMS).flat_map do |batched_series| client_series(*batched_series, start: timeframe_start, stop: timeframe_end) - .select(&method(:has_matching_label)) + .select(&method(:has_matching_label?)) .map { |series_info| [series_info['__name__'], true] } end lookup.to_h end - def has_matching_label(series_info) + def has_matching_label?(series_info) series_info.key?('environment') end |