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
cce5d7bd
Commit
cce5d7bd
authored
Jul 26, 2021
by
Rajendra Kadam
Committed by
Markus Koller
Jul 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add License metric classes for Zuora Subscription ID and License MD5
parent
a0f715ed
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
0 deletions
+76
-0
ee/config/metrics/license/20210204124831_license_md5.yml
ee/config/metrics/license/20210204124831_license_md5.yml
+1
-0
ee/config/metrics/license/20210204124852_license_subscription_id.yml
...etrics/license/20210204124852_license_subscription_id.yml
+1
-0
ee/lib/gitlab/usage/metrics/instrumentations/license_md_five_metric.rb
.../usage/metrics/instrumentations/license_md_five_metric.rb
+15
-0
ee/lib/gitlab/usage/metrics/instrumentations/zuora_subscription_id_metric.rb
.../metrics/instrumentations/zuora_subscription_id_metric.rb
+15
-0
ee/spec/lib/gitlab/usage/metrics/instrumentations/license_md_five_metric_spec.rb
...e/metrics/instrumentations/license_md_five_metric_spec.rb
+9
-0
ee/spec/lib/gitlab/usage/metrics/instrumentations/zuora_subscription_id_metric_spec.rb
...ics/instrumentations/zuora_subscription_id_metric_spec.rb
+9
-0
ee/spec/lib/gitlab/usage_data_metrics_spec.rb
ee/spec/lib/gitlab/usage_data_metrics_spec.rb
+26
-0
No files found.
ee/config/metrics/license/20210204124831_license_md5.yml
View file @
cce5d7bd
...
...
@@ -9,6 +9,7 @@ value_type: string
status
:
data_available
time_frame
:
none
data_source
:
license
instrumentation_class
:
'
LicenseMdFiveMetric'
data_category
:
Standard
distribution
:
-
ee
...
...
ee/config/metrics/license/20210204124852_license_subscription_id.yml
View file @
cce5d7bd
...
...
@@ -9,6 +9,7 @@ value_type: string
status
:
data_available
time_frame
:
none
data_source
:
license
instrumentation_class
:
'
ZuoraSubscriptionIdMetric'
data_category
:
Standard
distribution
:
-
ee
...
...
ee/lib/gitlab/usage/metrics/instrumentations/license_md_five_metric.rb
0 → 100644
View file @
cce5d7bd
# frozen_string_literal: true
module
Gitlab
module
Usage
module
Metrics
module
Instrumentations
class
LicenseMdFiveMetric
<
::
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
GenericMetric
value
do
::
License
.
current
.
md5
end
end
end
end
end
end
ee/lib/gitlab/usage/metrics/instrumentations/zuora_subscription_id_metric.rb
0 → 100644
View file @
cce5d7bd
# frozen_string_literal: true
module
Gitlab
module
Usage
module
Metrics
module
Instrumentations
class
ZuoraSubscriptionIdMetric
<
::
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
GenericMetric
value
do
::
License
.
current
.
subscription_id
end
end
end
end
end
end
ee/spec/lib/gitlab/usage/metrics/instrumentations/license_md_five_metric_spec.rb
0 → 100644
View file @
cce5d7bd
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
LicenseMdFiveMetric
do
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
data_source:
'ruby'
}
do
let
(
:expected_value
)
{
Digest
::
MD5
.
hexdigest
(
::
License
.
current
.
data
)
}
end
end
ee/spec/lib/gitlab/usage/metrics/instrumentations/zuora_subscription_id_metric_spec.rb
0 → 100644
View file @
cce5d7bd
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
ZuoraSubscriptionIdMetric
do
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
data_source:
'ruby'
}
do
let
(
:expected_value
)
{
::
License
.
current
.
subscription_id
}
end
end
ee/spec/lib/gitlab/usage_data_metrics_spec.rb
0 → 100644
View file @
cce5d7bd
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
UsageDataMetrics
do
describe
'.uncached_data'
do
subject
{
described_class
.
uncached_data
}
around
do
|
example
|
described_class
.
instance_variable_set
(
:@definitions
,
nil
)
example
.
run
described_class
.
instance_variable_set
(
:@definitions
,
nil
)
end
before
do
allow
(
ActiveRecord
::
Base
.
connection
).
to
receive
(
:transaction_open?
).
and_return
(
false
)
# rubocop:disable Database/MultipleDatabases
end
context
'with instrumentation_class'
do
it
'includes top level keys'
do
expect
(
subject
).
to
include
(
:license_md5
)
expect
(
subject
).
to
include
(
:license_subscription_id
)
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