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
86f6a43f
Commit
86f6a43f
authored
Sep 16, 2021
by
Nicolas Dular
Committed by
Alper Akgun
Sep 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add usage ping feature metric
parent
115b29aa
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
1 deletion
+64
-1
config/metrics/settings/20210915152326_service_ping_features_enabled.yml
...settings/20210915152326_service_ping_features_enabled.yml
+23
-0
lib/gitlab/usage/metrics/instrumentations/service_ping_features_metric.rb
.../metrics/instrumentations/service_ping_features_metric.rb
+15
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+2
-1
spec/lib/gitlab/usage/metrics/instrumentations/service_ping_features_metric_spec.rb
...ics/instrumentations/service_ping_features_metric_spec.rb
+20
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+4
-0
No files found.
config/metrics/settings/20210915152326_service_ping_features_enabled.yml
0 → 100644
View file @
86f6a43f
---
key_path
:
settings.service_ping_features_enabled
name
:
"
service_ping_features_enabled"
description
:
Whether Service Ping features are enabled
product_section
:
growth
product_stage
:
growth
product_group
:
group::product intelligence
product_category
:
collection
value_type
:
boolean
status
:
active
milestone
:
"
14.3"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70332
time_frame
:
none
data_source
:
database
instrumentation_class
:
ServicePingFeaturesMetric
data_category
:
optional
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
lib/gitlab/usage/metrics/instrumentations/service_ping_features_metric.rb
0 → 100644
View file @
86f6a43f
# frozen_string_literal: true
module
Gitlab
module
Usage
module
Metrics
module
Instrumentations
class
ServicePingFeaturesMetric
<
GenericMetric
value
do
Gitlab
::
CurrentSettings
.
usage_ping_features_enabled
end
end
end
end
end
end
lib/gitlab/usage_data.rb
View file @
86f6a43f
...
...
@@ -259,7 +259,8 @@ module Gitlab
smtp_encrypted_secrets_enabled:
alt_usage_data
(
fallback:
nil
)
{
Gitlab
::
Email
::
SmtpConfig
.
encrypted_secrets
.
active?
},
operating_system:
alt_usage_data
(
fallback:
nil
)
{
operating_system
},
gitaly_apdex:
alt_usage_data
{
gitaly_apdex
},
collected_data_categories:
add_metric
(
'CollectedDataCategoriesMetric'
,
time_frame:
'none'
)
collected_data_categories:
add_metric
(
'CollectedDataCategoriesMetric'
,
time_frame:
'none'
),
service_ping_features_enabled:
add_metric
(
'ServicePingFeaturesMetric'
,
time_frame:
'none'
)
}
}
end
...
...
spec/lib/gitlab/usage/metrics/instrumentations/service_ping_features_metric_spec.rb
0 → 100644
View file @
86f6a43f
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
ServicePingFeaturesMetric
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:usage_ping_features_enabled
,
:expected_value
)
do
true
|
true
false
|
false
end
with_them
do
before
do
stub_application_setting
(
usage_ping_features_enabled:
usage_ping_features_enabled
)
end
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
}
end
end
spec/lib/gitlab/usage_data_spec.rb
View file @
86f6a43f
...
...
@@ -1089,6 +1089,10 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect
(
subject
[
:settings
][
:collected_data_categories
]).
to
eq
(
expected_value
)
end
it
'gathers service_ping_features_enabled'
do
expect
(
subject
[
:settings
][
:service_ping_features_enabled
]).
to
eq
(
Gitlab
::
CurrentSettings
.
usage_ping_features_enabled
)
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