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
ae9cc6e1
Commit
ae9cc6e1
authored
Oct 10, 2019
by
Tetiana Chupryna
Committed by
Douglas Barbosa Alexandre
Oct 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add licenses list counter
Calculate backend usage of the feature
parent
fe62f194
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
1 deletion
+34
-1
ee/app/controllers/projects/security/licenses_controller.rb
ee/app/controllers/projects/security/licenses_controller.rb
+2
-0
ee/changelogs/unreleased/14732-usage-ping.yml
ee/changelogs/unreleased/14732-usage-ping.yml
+5
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+1
-1
ee/lib/gitlab/usage_data_counters/licenses_list.rb
ee/lib/gitlab/usage_data_counters/licenses_list.rb
+10
-0
ee/spec/controllers/projects/security/licenses_controller_spec.rb
...controllers/projects/security/licenses_controller_spec.rb
+6
-0
ee/spec/lib/gitlab/usage_data_counters/licenses_list_spec.rb
ee/spec/lib/gitlab/usage_data_counters/licenses_list_spec.rb
+9
-0
ee/spec/lib/gitlab/usage_data_spec.rb
ee/spec/lib/gitlab/usage_data_spec.rb
+1
-0
No files found.
ee/app/controllers/projects/security/licenses_controller.rb
View file @
ae9cc6e1
...
@@ -8,6 +8,8 @@ module Projects
...
@@ -8,6 +8,8 @@ module Projects
def
index
def
index
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
json
do
format
.
json
do
::
Gitlab
::
UsageDataCounters
::
LicensesList
.
count
(
:views
)
render
json:
serializer
.
represent
(
licenses
,
build:
report_service
.
build
)
render
json:
serializer
.
represent
(
licenses
,
build:
report_service
.
build
)
end
end
end
end
...
...
ee/changelogs/unreleased/14732-usage-ping.yml
0 → 100644
View file @
ae9cc6e1
---
title
:
Add Licenses list backend usage ping
merge_request
:
17925
author
:
type
:
added
ee/lib/ee/gitlab/usage_data.rb
View file @
ae9cc6e1
...
@@ -10,7 +10,7 @@ module EE
...
@@ -10,7 +10,7 @@ module EE
override
:usage_data_counters
override
:usage_data_counters
def
usage_data_counters
def
usage_data_counters
super
+
[
::
Gitlab
::
UsageCounters
::
DesignsCounter
]
super
+
[
::
Gitlab
::
UsageCounters
::
DesignsCounter
,
::
Gitlab
::
UsageDataCounters
::
LicensesList
]
end
end
override
:uncached_data
override
:uncached_data
...
...
ee/lib/gitlab/usage_data_counters/licenses_list.rb
0 → 100644
View file @
ae9cc6e1
# frozen_string_literal: true
module
Gitlab
module
UsageDataCounters
class
LicensesList
<
BaseCounter
KNOWN_EVENTS
=
%w[views]
.
freeze
PREFIX
=
'licenses_list'
end
end
end
ee/spec/controllers/projects/security/licenses_controller_spec.rb
View file @
ae9cc6e1
...
@@ -23,6 +23,12 @@ describe Projects::Security::LicensesController do
...
@@ -23,6 +23,12 @@ describe Projects::Security::LicensesController do
stub_licensed_features
(
licenses_list:
true
,
license_management:
true
)
stub_licensed_features
(
licenses_list:
true
,
license_management:
true
)
end
end
it
'counts usage of the feature'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
LicensesList
).
to
receive
(
:count
).
with
(
:views
)
get_licenses
end
context
'with existing report'
do
context
'with existing report'
do
let!
(
:pipeline
)
{
create
(
:ee_ci_pipeline
,
:with_license_management_report
,
project:
project
)
}
let!
(
:pipeline
)
{
create
(
:ee_ci_pipeline
,
:with_license_management_report
,
project:
project
)
}
...
...
ee/spec/lib/gitlab/usage_data_counters/licenses_list_spec.rb
0 → 100644
View file @
ae9cc6e1
# frozen_string_literal: true
require
'spec_helper'
describe
Gitlab
::
UsageDataCounters
::
LicensesList
do
it_behaves_like
'a redis usage counter'
,
'LicensesList'
,
:views
it_behaves_like
'a redis usage counter with totals'
,
:licenses_list
,
views:
7
end
ee/spec/lib/gitlab/usage_data_spec.rb
View file @
ae9cc6e1
...
@@ -72,6 +72,7 @@ describe Gitlab::UsageData do
...
@@ -72,6 +72,7 @@ describe Gitlab::UsageData do
ldap_keys
ldap_keys
ldap_users
ldap_users
license_management_jobs
license_management_jobs
licenses_list_views
operations_dashboard_default_dashboard
operations_dashboard_default_dashboard
operations_dashboard_users_with_projects_added
operations_dashboard_users_with_projects_added
pod_logs_usages_total
pod_logs_usages_total
...
...
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