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
b3b33281
Commit
b3b33281
authored
Oct 20, 2021
by
Nikolay Belokolodov
Committed by
Douglas Barbosa Alexandre
Oct 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate historical_max_users metric to Instrumentation class
parent
41fbe34a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
2 deletions
+27
-2
ee/config/metrics/license/20210204124835_historical_max_users.yml
...g/metrics/license/20210204124835_historical_max_users.yml
+1
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+1
-1
ee/lib/gitlab/usage/metrics/instrumentations/historical_max_users_metric.rb
...e/metrics/instrumentations/historical_max_users_metric.rb
+15
-0
ee/spec/lib/ee/gitlab/usage_data_non_sql_metrics_spec.rb
ee/spec/lib/ee/gitlab/usage_data_non_sql_metrics_spec.rb
+1
-1
ee/spec/lib/gitlab/usage/metrics/instrumentations/historical_max_users_metrics_spec.rb
...ics/instrumentations/historical_max_users_metrics_spec.rb
+9
-0
No files found.
ee/config/metrics/license/20210204124835_historical_max_users.yml
View file @
b3b33281
...
@@ -7,6 +7,7 @@ product_group: group::license
...
@@ -7,6 +7,7 @@ product_group: group::license
product_category
:
license
product_category
:
license
value_type
:
number
value_type
:
number
status
:
active
status
:
active
instrumentation_class
:
HistoricalMaxUsersMetric
time_frame
:
none
time_frame
:
none
data_source
:
database
data_source
:
database
data_category
:
subscription
data_category
:
subscription
...
...
ee/lib/ee/gitlab/usage_data.rb
View file @
b3b33281
...
@@ -93,7 +93,7 @@ module EE
...
@@ -93,7 +93,7 @@ module EE
usage_data
[
:license_md5
]
=
license
.
md5
usage_data
[
:license_md5
]
=
license
.
md5
usage_data
[
:license_id
]
=
license
.
license_id
usage_data
[
:license_id
]
=
license
.
license_id
# rubocop: disable UsageData/LargeTable
# rubocop: disable UsageData/LargeTable
usage_data
[
:historical_max_users
]
=
license
.
historical_max
usage_data
[
:historical_max_users
]
=
add_metric
(
"HistoricalMaxUsersMetric"
)
# rubocop: enable UsageData/LargeTable
# rubocop: enable UsageData/LargeTable
usage_data
[
:licensee
]
=
license
.
licensee
usage_data
[
:licensee
]
=
license
.
licensee
usage_data
[
:license_user_count
]
=
license
.
restricted_user_count
usage_data
[
:license_user_count
]
=
license
.
restricted_user_count
...
...
ee/lib/gitlab/usage/metrics/instrumentations/historical_max_users_metric.rb
0 → 100644
View file @
b3b33281
# frozen_string_literal: true
module
Gitlab
module
Usage
module
Metrics
module
Instrumentations
class
HistoricalMaxUsersMetric
<
::
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
GenericMetric
value
do
::
License
.
current
.
historical_max
end
end
end
end
end
end
ee/spec/lib/ee/gitlab/usage_data_non_sql_metrics_spec.rb
View file @
b3b33281
...
@@ -15,7 +15,7 @@ RSpec.describe Gitlab::UsageDataNonSqlMetrics do
...
@@ -15,7 +15,7 @@ RSpec.describe Gitlab::UsageDataNonSqlMetrics do
described_class
.
uncached_data
described_class
.
uncached_data
end
end
expect
(
recorder
.
count
).
to
eq
(
5
4
)
expect
(
recorder
.
count
).
to
eq
(
5
5
)
end
end
end
end
end
end
ee/spec/lib/gitlab/usage/metrics/instrumentations/historical_max_users_metrics_spec.rb
0 → 100644
View file @
b3b33281
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Usage
::
Metrics
::
Instrumentations
::
HistoricalMaxUsersMetric
do
it_behaves_like
'a correct instrumented metric value'
,
{
time_frame:
'none'
,
data_source:
'ruby'
}
do
let
(
:expected_value
)
{
::
License
.
current
.
historical_max
}
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