Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c6f8bb64
Commit
c6f8bb64
authored
Apr 01, 2021
by
Mikolaj Wawrzyniak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change name suggestion for redis events
Expande name suggestion prompt for redis with suggested format
parent
5c7dabbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
lib/gitlab/usage/metrics/names_suggestions/generator.rb
lib/gitlab/usage/metrics/names_suggestions/generator.rb
+3
-2
spec/lib/gitlab/usage/metrics/names_suggestions/generator_spec.rb
.../gitlab/usage/metrics/names_suggestions/generator_spec.rb
+1
-1
No files found.
lib/gitlab/usage/metrics/names_suggestions/generator.rb
View file @
c6f8bb64
...
...
@@ -6,6 +6,7 @@ module Gitlab
module
NamesSuggestions
class
Generator
<
::
Gitlab
::
UsageData
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}'>"
class
<<
self
...
...
@@ -24,7 +25,7 @@ module Gitlab
end
def
redis_usage_counter
FREE_TEX
T_METRIC_NAME
REDIS_EVEN
T_METRIC_NAME
end
def
alt_usage_data
(
*
)
...
...
@@ -32,7 +33,7 @@ module Gitlab
end
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
def
sum
(
relation
,
column
,
*
rest
)
...
...
spec/lib/gitlab/usage/metrics/names_suggestions/generator_spec.rb
View file @
c6f8bb64
...
...
@@ -89,7 +89,7 @@ RSpec.describe Gitlab::Usage::Metrics::NamesSuggestions::Generator do
it_behaves_like
'name suggestion'
do
# 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
(
: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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment