Commit 12c99ada authored by Luis Mejia's avatar Luis Mejia

Remove duplicated metric entry

parent 7feeafc2
...@@ -14,15 +14,11 @@ instrumentation_class: RedisHLLMetric ...@@ -14,15 +14,11 @@ instrumentation_class: RedisHLLMetric
options: options:
events: events:
- i_quickactions_reassign_reviewer - i_quickactions_reassign_reviewer
instrumentation_class: RedisHLLMetric
options:
events:
- i_quickactions_reassign
distribution: distribution:
- ce - ce
- ee - ee
tier: tier:
- free - free
- premium - premium
- ultimate - ultimate
...@@ -26,7 +26,7 @@ RSpec.describe Gitlab::UsageDataMetrics do ...@@ -26,7 +26,7 @@ RSpec.describe Gitlab::UsageDataMetrics do
expect(subject[:counts]).to include(:boards) expect(subject[:counts]).to include(:boards)
end end
context 'when redis_hll_counters' do describe 'Redis_HLL_counters' do
# categories to be merged on future MR # categories to be merged on future MR
let(:ignored_metric_files_key_patterns) do let(:ignored_metric_files_key_patterns) do
%w( %w(
...@@ -53,10 +53,10 @@ RSpec.describe Gitlab::UsageDataMetrics do ...@@ -53,10 +53,10 @@ RSpec.describe Gitlab::UsageDataMetrics do
# Recursively traverse nested Hash of a generated Usage Ping to return an Array of key paths # Recursively traverse nested Hash of a generated Usage Ping to return an Array of key paths
# in the dotted format used in metric definition YAML files, e.g.: 'count.category.metric_name' # in the dotted format used in metric definition YAML files, e.g.: 'count.category.metric_name'
def parse_usage_ping_keys(object, key_path = []) def parse_service_ping_keys(object, key_path = [])
if object.is_a?(Hash) if object.is_a?(Hash)
object.each_with_object([]) do |(key, value), result| object.each_with_object([]) do |(key, value), result|
result.append parse_usage_ping_keys(value, key_path + [key]) result.append parse_service_ping_keys(value, key_path + [key])
end end
else else
key_path.join('.') key_path.join('.')
...@@ -64,7 +64,7 @@ RSpec.describe Gitlab::UsageDataMetrics do ...@@ -64,7 +64,7 @@ RSpec.describe Gitlab::UsageDataMetrics do
end end
let(:usage_ping_key_paths) do let(:usage_ping_key_paths) do
parse_usage_ping_keys(subject) parse_service_ping_keys(subject)
.flatten .flatten
.select { |k| k.starts_with?('redis_hll_counters') } .select { |k| k.starts_with?('redis_hll_counters') }
.reject {|k| k =~ Regexp.union(ignored_metric_files_key_patterns) } .reject {|k| k =~ Regexp.union(ignored_metric_files_key_patterns) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment