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
7e48ea6f
Commit
7e48ea6f
authored
Jun 12, 2019
by
Peter Leitzen
Committed by
Rémy Coutable
Jun 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Usage ping: Track amount of incident issues
These are issues created by the `Alert Bot`.
parent
bbb52fbb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
app/controllers/admin/application_settings_controller.rb
app/controllers/admin/application_settings_controller.rb
+6
-0
ee/changelogs/unreleased/10891-usage-ping-for-incident-management.yml
...s/unreleased/10891-usage-ping-for-incident-management.yml
+5
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+2
-1
ee/spec/lib/gitlab/usage_data_spec.rb
ee/spec/lib/gitlab/usage_data_spec.rb
+4
-0
No files found.
app/controllers/admin/application_settings_controller.rb
View file @
7e48ea6f
...
...
@@ -2,7 +2,9 @@
class
Admin::ApplicationSettingsController
<
Admin
::
ApplicationController
include
InternalRedirect
before_action
:set_application_setting
before_action
:whitelist_query_limiting
,
only:
[
:usage_data
]
def
show
end
...
...
@@ -102,6 +104,10 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
@application_setting
=
Gitlab
::
CurrentSettings
.
current_application_settings
end
def
whitelist_query_limiting
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ce/issues/63107'
)
end
def
application_setting_params
params
[
:application_setting
]
||=
{}
...
...
ee/changelogs/unreleased/10891-usage-ping-for-incident-management.yml
0 → 100644
View file @
7e48ea6f
---
title
:
'
Usage
ping:
Track
amount
of
incident
issues'
merge_request
:
14013
author
:
type
:
added
ee/lib/ee/gitlab/usage_data.rb
View file @
7e48ea6f
...
...
@@ -133,7 +133,8 @@ module EE
projects_with_tracing_enabled:
count
(
ProjectTracingSetting
),
projects_enforcing_code_owner_approval:
count
(
::
Project
.
without_deleted
.
non_archived
.
requiring_code_owner_approval
),
operations_dashboard:
operations_dashboard_usage
,
dependency_list_usages_total:
::
Gitlab
::
UsageCounters
::
DependencyList
.
usage_totals
[
:total
]
dependency_list_usages_total:
::
Gitlab
::
UsageCounters
::
DependencyList
.
usage_totals
[
:total
],
incident_issues:
count
(
::
Issue
.
authored
(
::
User
.
alert_bot
))
}).
merge
(
service_desk_counts
).
merge
(
security_products_usage
)
# MySql does not support recursive queries so we can't retrieve epics relationship depth
...
...
ee/spec/lib/gitlab/usage_data_spec.rb
View file @
7e48ea6f
...
...
@@ -34,6 +34,8 @@ describe Gitlab::UsageData do
# for group_view testing
create
(
:user
)
# user with group_view = NULL (should be counted as having default value 'details')
create
(
:user
,
group_view: :details
)
create
(
:issue
,
project:
projects
[
0
],
author:
User
.
alert_bot
)
end
subject
{
described_class
.
data
}
...
...
@@ -83,11 +85,13 @@ describe Gitlab::UsageData do
feature_flags
operations_dashboard
dependency_list_usages_total
incident_issues
)
)
expect
(
count_data
[
:projects_with_prometheus_alerts
]).
to
eq
(
2
)
expect
(
count_data
[
:projects_with_packages
]).
to
eq
(
2
)
expect
(
count_data
[
:feature_flags
]).
to
eq
(
1
)
expect
(
count_data
[
:incident_issues
]).
to
eq
(
1
)
end
it
'gathers deepest epic relationship level'
,
:postgresql
do
...
...
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