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
38676f60
Commit
38676f60
authored
Feb 10, 2021
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add value_type to generator template
parent
756cb64a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
generator_templates/usage_metric_definition/metric_definition.yml
...r_templates/usage_metric_definition/metric_definition.yml
+7
-5
lib/generators/gitlab/usage_metric_definition_generator.rb
lib/generators/gitlab/usage_metric_definition_generator.rb
+10
-6
No files found.
generator_templates/usage_metric_definition/metric_definition.yml
View file @
38676f60
# See Usage Ping metrics dictionary docs https://docs.gitlab.com/ee/development/usage_ping/metrics_dictionary.html
key_path
:
<%= key_path %>
value_type
:
description
:
product_section
:
product_stage
:
product_group
:
product_category
:
stage
:
status
:
value_type
:
<%= value_type %>
status
:
implemented
milestone
:
introduced_by_url
:
group
:
time_frame
:
<%= time_frame %>
data_source
:
distribution
:
<%= distribution %>
# tier: ['free', '
starter', 'premium', 'ultimate', 'bronze', 'silver', 'gold
']
# tier: ['free', '
premium', 'ultimate
']
tier
:
lib/generators/gitlab/usage_metric_definition_generator.rb
View file @
38676f60
...
...
@@ -4,18 +4,18 @@ require 'rails/generators'
module
Gitlab
class
UsageMetricDefinitionGenerator
<
Rails
::
Generators
::
Base
Directory
=
Struct
.
new
(
:name
,
:time_frame
)
do
Directory
=
Struct
.
new
(
:name
,
:time_frame
,
:value_type
)
do
def
match?
(
str
)
(
name
==
str
||
time_frame
==
str
)
&&
str
!=
'none'
end
end
TIME_FRAME_DIRS
=
[
Directory
.
new
(
'counts_7d'
,
'7d'
),
Directory
.
new
(
'counts_28d'
,
'28d'
),
Directory
.
new
(
'counts_all'
,
'all'
),
Directory
.
new
(
'settings'
,
'none'
),
Directory
.
new
(
'license'
,
'none'
)
Directory
.
new
(
'counts_7d'
,
'7d'
,
'number'
),
Directory
.
new
(
'counts_28d'
,
'28d'
,
'number'
),
Directory
.
new
(
'counts_all'
,
'all'
,
'number'
),
Directory
.
new
(
'settings'
,
'none'
,
'boolean'
),
Directory
.
new
(
'license'
,
'none'
,
'string'
)
].
freeze
VALID_INPUT_DIRS
=
(
TIME_FRAME_DIRS
.
flat_map
{
|
d
|
[
d
.
name
,
d
.
time_frame
]
}
-
%w(none)
).
freeze
...
...
@@ -40,6 +40,10 @@ module Gitlab
directory
&
.
time_frame
end
def
value_type
directory
&
.
value_type
end
def
distribution
value
=
[
'ce'
]
value
<<
'ee'
if
ee?
...
...
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