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
748d9544
Commit
748d9544
authored
Jul 29, 2020
by
Arturo Herrero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exclude instance services from usage data
parent
5abc620d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+1
-1
spec/factories/usage_data.rb
spec/factories/usage_data.rb
+1
-0
No files found.
lib/gitlab/usage_data.rb
View file @
748d9544
...
...
@@ -355,7 +355,7 @@ module Gitlab
def
services_usage
# rubocop: disable UsageData/LargeTable:
Service
.
available_services_names
.
each_with_object
({})
do
|
service_name
,
response
|
response
[
"projects_
#{
service_name
}
_active"
.
to_sym
]
=
count
(
Service
.
active
.
where
(
template:
false
,
type:
"
#{
service_name
}
_service"
.
camelize
))
response
[
"projects_
#{
service_name
}
_active"
.
to_sym
]
=
count
(
Service
.
active
.
where
(
template:
false
,
instance:
false
,
type:
"
#{
service_name
}
_service"
.
camelize
))
end
.
merge
(
jira_usage
,
jira_import_usage
)
# rubocop: enable UsageData/LargeTable:
end
...
...
spec/factories/usage_data.rb
View file @
748d9544
...
...
@@ -24,6 +24,7 @@ FactoryBot.define do
create
(
:service
,
project:
projects
[
2
],
type:
'SlackService'
,
active:
true
)
create
(
:service
,
project:
projects
[
2
],
type:
'MattermostService'
,
active:
false
)
create
(
:service
,
:template
,
type:
'MattermostService'
,
active:
true
)
create
(
:service
,
:instance
,
type:
'MattermostService'
,
active:
true
)
create
(
:service
,
project:
projects
[
2
],
type:
'CustomIssueTrackerService'
,
active:
true
)
create
(
:project_error_tracking_setting
,
project:
projects
[
0
])
create
(
:project_error_tracking_setting
,
project:
projects
[
1
],
enabled:
false
)
...
...
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