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
192951b4
Commit
192951b4
authored
Feb 12, 2021
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve metrics generator
parent
795fbb0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
doc/development/usage_ping/metrics_dictionary.md
doc/development/usage_ping/metrics_dictionary.md
+7
-2
generator_templates/usage_metric_definition/metric_definition.yml
...r_templates/usage_metric_definition/metric_definition.yml
+9
-4
lib/generators/gitlab/usage_metric_definition_generator.rb
lib/generators/gitlab/usage_metric_definition_generator.rb
+7
-3
No files found.
doc/development/usage_ping/metrics_dictionary.md
View file @
192951b4
...
...
@@ -59,8 +59,13 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1521
product_group
:
group::product intelligence
time_frame
:
none
data_source
:
database
distribution
:
[
ee
,
ce
]
tier
:
[
'
free'
,
'
starter'
,
'
premium'
,
'
ultimate'
,
'
bronze'
,
'
silver'
,
'
gold'
]
distribution
:
-
ee
-
ce
tier
:
-
free
-
premium
-
ultimate
```
## Create a new metric definition
...
...
generator_templates/usage_metric_definition/metric_definition.yml
View file @
192951b4
---
# See Usage Ping metrics dictionary docs https://docs.gitlab.com/ee/development/usage_ping/metrics_dictionary.html
key_path
:
<%= key_path %>
description
:
...
...
@@ -7,10 +8,14 @@ product_group:
product_category
:
value_type
:
<%= value_type %>
status
:
implemented
milestone
:
milestone
:
<%= milestone %>
introduced_by_url
:
time_frame
:
<%= time_frame %>
data_source
:
distribution
:
<%= distribution %>
# tier: ['free', 'premium', 'ultimate']
tier
:
distribution
:
<%= distribution %>
# Add here corresponding tiers
# tier:
# - free
# - premium
# - ultimate
lib/generators/gitlab/usage_metric_definition_generator.rb
View file @
192951b4
...
...
@@ -45,9 +45,13 @@ module Gitlab
end
def
distribution
value
=
[
'ce'
]
value
<<
'ee'
if
ee?
value
value
=
[
'- ce'
]
value
<<
'- ee'
if
ee?
value
.
join
(
"
\n
"
)
end
def
milestone
Gitlab
::
VERSION
.
match
(
'(\d+\.\d+)'
).
captures
.
first
end
private
...
...
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