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
a077b345
Commit
a077b345
authored
Oct 14, 2021
by
Chase Southard
Committed by
Ash McKenzie
Oct 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds User Cap instrumentation
parent
fcd59974
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
1 deletion
+62
-1
ee/config/metrics/settings/20211005184521_user_cap_feature_enabled.yml
...rics/settings/20211005184521_user_cap_feature_enabled.yml
+20
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+2
-1
ee/lib/gitlab/usage/metrics/instrumentations/user_cap_setting_enabled_metric.rb
...trics/instrumentations/user_cap_setting_enabled_metric.rb
+15
-0
ee/spec/lib/ee/gitlab/usage/metrics/instrumentations/user_cap_setting_enabled_metric_spec.rb
.../instrumentations/user_cap_setting_enabled_metric_spec.rb
+21
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+4
-0
No files found.
ee/config/metrics/settings/20211005184521_user_cap_feature_enabled.yml
0 → 100644
View file @
a077b345
---
key_path
:
user_cap_feature_enabled
description
:
Whether User Cap feature is enabled
product_section
:
fulfillment
product_stage
:
fulfillment
product_group
:
group::utilization
product_category
:
utilization
value_type
:
number
status
:
active
milestone
:
"
14.4"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71786
instrumentation_class
:
UserCapSettingEnabledMetric
time_frame
:
none
data_source
:
database
data_category
:
optional
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/lib/ee/gitlab/usage_data.rb
View file @
a077b345
...
@@ -73,7 +73,8 @@ module EE
...
@@ -73,7 +73,8 @@ module EE
{
{
elasticsearch_enabled:
alt_usage_data
(
fallback:
nil
)
{
::
Gitlab
::
CurrentSettings
.
elasticsearch_search?
},
elasticsearch_enabled:
alt_usage_data
(
fallback:
nil
)
{
::
Gitlab
::
CurrentSettings
.
elasticsearch_search?
},
license_trial_ends_on:
alt_usage_data
(
fallback:
nil
)
{
License
.
trial_ends_on
},
license_trial_ends_on:
alt_usage_data
(
fallback:
nil
)
{
License
.
trial_ends_on
},
geo_enabled:
alt_usage_data
(
fallback:
nil
)
{
::
Gitlab
::
Geo
.
enabled?
}
geo_enabled:
alt_usage_data
(
fallback:
nil
)
{
::
Gitlab
::
Geo
.
enabled?
},
user_cap_feature_enabled:
add_metric
(
'UserCapSettingEnabledMetric'
,
time_frame:
'none'
)
}
}
end
end
...
...
ee/lib/gitlab/usage/metrics/instrumentations/user_cap_setting_enabled_metric.rb
0 → 100644
View file @
a077b345
# frozen_string_literal: true
module
Gitlab
module
Usage
module
Metrics
module
Instrumentations
class
UserCapSettingEnabledMetric
<
::
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
GenericMetric
value
do
::
Gitlab
::
CurrentSettings
.
new_user_signups_cap
end
end
end
end
end
end
ee/spec/lib/ee/gitlab/usage/metrics/instrumentations/user_cap_setting_enabled_metric_spec.rb
0 → 100644
View file @
a077b345
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
::
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
UserCapSettingEnabledMetric
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:user_cap_feature_enabled
,
:expected_value
)
do
42
|
42
-
1
|
-
1
end
with_them
do
before
do
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
stub_application_setting
(
new_user_signups_cap:
user_cap_feature_enabled
)
end
it_behaves_like
'a correct instrumented metric value'
,
{}
end
end
spec/lib/gitlab/usage_data_spec.rb
View file @
a077b345
...
@@ -1074,6 +1074,10 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
...
@@ -1074,6 +1074,10 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
it
'gathers service_ping_features_enabled'
do
it
'gathers service_ping_features_enabled'
do
expect
(
subject
[
:settings
][
:service_ping_features_enabled
]).
to
eq
(
Gitlab
::
CurrentSettings
.
usage_ping_features_enabled
)
expect
(
subject
[
:settings
][
:service_ping_features_enabled
]).
to
eq
(
Gitlab
::
CurrentSettings
.
usage_ping_features_enabled
)
end
end
it
'gathers user_cap_feature_enabled'
do
expect
(
subject
[
:settings
][
:user_cap_feature_enabled
]).
to
eq
(
Gitlab
::
CurrentSettings
.
new_user_signups_cap
)
end
end
end
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