Commit c6f8bb64 authored by Mikolaj Wawrzyniak's avatar Mikolaj Wawrzyniak

Change name suggestion for redis events

Expande name suggestion prompt for redis with suggested format
parent 5c7dabbf
...@@ -6,6 +6,7 @@ module Gitlab ...@@ -6,6 +6,7 @@ module Gitlab
module NamesSuggestions module NamesSuggestions
class Generator < ::Gitlab::UsageData class Generator < ::Gitlab::UsageData
FREE_TEXT_METRIC_NAME = "<please fill metric name>" FREE_TEXT_METRIC_NAME = "<please fill metric name>"
REDIS_EVENT_METRIC_NAME = "<please fill metric name, suggested format is: who_is_doing_what eg: users_creating_epics>"
CONSTRAINTS_PROMPT_TEMPLATE = "<adjective describing: '%{constraints}'>" CONSTRAINTS_PROMPT_TEMPLATE = "<adjective describing: '%{constraints}'>"
class << self class << self
...@@ -24,7 +25,7 @@ module Gitlab ...@@ -24,7 +25,7 @@ module Gitlab
end end
def redis_usage_counter def redis_usage_counter
FREE_TEXT_METRIC_NAME REDIS_EVENT_METRIC_NAME
end end
def alt_usage_data(*) def alt_usage_data(*)
...@@ -32,7 +33,7 @@ module Gitlab ...@@ -32,7 +33,7 @@ module Gitlab
end end
def redis_usage_data_totals(counter) def redis_usage_data_totals(counter)
counter.fallback_totals.transform_values { |_| FREE_TEXT_METRIC_NAME} counter.fallback_totals.transform_values { |_| REDIS_EVENT_METRIC_NAME }
end end
def sum(relation, column, *rest) def sum(relation, column, *rest)
......
...@@ -89,7 +89,7 @@ RSpec.describe Gitlab::Usage::Metrics::NamesSuggestions::Generator do ...@@ -89,7 +89,7 @@ RSpec.describe Gitlab::Usage::Metrics::NamesSuggestions::Generator do
it_behaves_like 'name suggestion' do it_behaves_like 'name suggestion' do
# corresponding metric is collected with redis_usage_data { unique_visit_service.unique_visits_for(targets: :analytics) } # corresponding metric is collected with redis_usage_data { unique_visit_service.unique_visits_for(targets: :analytics) }
let(:key_path) { 'analytics_unique_visits.analytics_unique_visits_for_any_target' } let(:key_path) { 'analytics_unique_visits.analytics_unique_visits_for_any_target' }
let(:name_suggestion) { /<please fill metric name>/ } let(:name_suggestion) { /<please fill metric name, suggested format is: who_is_doing_what eg: users_creating_epics>/ }
end end
end end
......
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