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
92530d88
Commit
92530d88
authored
Nov 23, 2021
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix license instrumented metrics
- Fix licnese_id - Fix license_trial - Add tests Fix Rubocop
parent
5bd757b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
4 deletions
+47
-4
ee/config/metrics/license/20210204124833_license_id.yml
ee/config/metrics/license/20210204124833_license_id.yml
+1
-1
ee/config/metrics/license/20210204124851_license_trial.yml
ee/config/metrics/license/20210204124851_license_trial.yml
+1
-1
ee/lib/gitlab/usage/metrics/instrumentations/license_metric.rb
...b/gitlab/usage/metrics/instrumentations/license_metric.rb
+2
-2
ee/spec/lib/gitlab/usage/metrics/instrumentations/license_metric_spec.rb
...lab/usage/metrics/instrumentations/license_metric_spec.rb
+43
-0
No files found.
ee/config/metrics/license/20210204124833_license_id.yml
View file @
92530d88
...
...
@@ -12,7 +12,7 @@ data_source: license
data_category
:
subscription
instrumentation_class
:
LicenseMetric
options
:
attribute
:
id
attribute
:
license_
id
distribution
:
-
ee
tier
:
...
...
ee/config/metrics/license/20210204124851_license_trial.yml
View file @
92530d88
...
...
@@ -12,7 +12,7 @@ data_source: license
data_category
:
subscription
instrumentation_class
:
LicenseMetric
options
:
attribute
:
trial
attribute
:
'
trial?'
distribution
:
-
ee
tier
:
...
...
ee/lib/gitlab/usage/metrics/instrumentations/license_metric.rb
View file @
92530d88
...
...
@@ -14,9 +14,9 @@ module Gitlab
# end
ALLOWED_ATTRIBUTES
=
%w(md5
id
license_
id
plan
trial
trial
?
starts_at
expires_at
user_count
...
...
ee/spec/lib/gitlab/usage/metrics/instrumentations/license_metric_spec.rb
0 → 100644
View file @
92530d88
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
LicenseMetric
do
let
(
:current_license
)
{
::
License
.
current
}
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
options:
{
attribute:
'trial?'
}
}
do
let
(
:expected_value
)
{
current_license
.
trial?
}
end
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
options:
{
attribute:
'license_id'
}
}
do
let
(
:expected_value
)
{
current_license
.
license_id
}
end
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
options:
{
attribute:
'expires_at'
}
}
do
let
(
:expected_value
)
{
current_license
.
expires_at
}
end
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
options:
{
attribute:
'md5'
}
}
do
let
(
:expected_value
)
{
current_license
.
md5
}
end
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
options:
{
attribute:
'trial_ends_on'
}
}
do
let
(
:expected_value
)
{
::
License
.
trial_ends_on
}
end
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
options:
{
attribute:
'plan'
}
}
do
let
(
:expected_value
)
{
current_license
.
plan
}
end
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
options:
{
attribute:
'subscription_id'
}
}
do
let
(
:expected_value
)
{
current_license
.
subscription_id
}
end
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
options:
{
attribute:
'starts_at'
}
}
do
let
(
:expected_value
)
{
current_license
.
starts_at
}
end
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
options:
{
attribute:
'user_count'
}
}
do
let
(
:expected_value
)
{
current_license
.
restricted_user_count
}
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