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
cb42bdae
Commit
cb42bdae
authored
May 10, 2021
by
Alina Mihaila
Committed by
Matthias Käppler
May 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add HostnameMetric in usage data
parent
27621069
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
1 deletion
+25
-1
config/metrics/license/20210204124827_hostname.yml
config/metrics/license/20210204124827_hostname.yml
+2
-1
lib/gitlab/usage/metrics/instrumentations/hostname_metric.rb
lib/gitlab/usage/metrics/instrumentations/hostname_metric.rb
+15
-0
spec/lib/gitlab/usage/metrics/instrumentations/hostname_metric_spec.rb
...ab/usage/metrics/instrumentations/hostname_metric_spec.rb
+7
-0
spec/lib/gitlab/usage_data_metrics_spec.rb
spec/lib/gitlab/usage_data_metrics_spec.rb
+1
-0
No files found.
config/metrics/license/20210204124827_hostname.yml
View file @
cb42bdae
...
...
@@ -8,7 +8,8 @@ product_category: collection
value_type
:
string
status
:
data_available
time_frame
:
none
data_source
:
data_source
:
ruby
instrumentation_class
:
'
Gitlab::Usage::Metrics::Instrumentations::HostnameMetric'
distribution
:
-
ce
-
ee
...
...
lib/gitlab/usage/metrics/instrumentations/hostname_metric.rb
0 → 100644
View file @
cb42bdae
# frozen_string_literal: true
module
Gitlab
module
Usage
module
Metrics
module
Instrumentations
class
HostnameMetric
<
GenericMetric
value
do
Gitlab
.
config
.
gitlab
.
host
end
end
end
end
end
end
spec/lib/gitlab/usage/metrics/instrumentations/hostname_metric_spec.rb
0 → 100644
View file @
cb42bdae
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
HostnameMetric
do
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
data_source:
'ruby'
},
Gitlab
.
config
.
gitlab
.
host
end
spec/lib/gitlab/usage_data_metrics_spec.rb
View file @
cb42bdae
...
...
@@ -19,6 +19,7 @@ RSpec.describe Gitlab::UsageDataMetrics do
context
'whith instrumentation_class'
do
it
'includes top level keys'
do
expect
(
subject
).
to
include
(
:uuid
)
expect
(
subject
).
to
include
(
:hostname
)
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