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
54477d44
Commit
54477d44
authored
Apr 06, 2020
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add issues with health status to usage data
Track count of issues with health status on usage data
parent
66f4082d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
0 deletions
+40
-0
db/post_migrate/20200406193427_add_index_to_issues_health_status.rb
...grate/20200406193427_add_index_to_issues_health_status.rb
+23
-0
db/structure.sql
db/structure.sql
+3
-0
doc/user/admin_area/settings/usage_statistics.md
doc/user/admin_area/settings/usage_statistics.md
+1
-0
ee/app/models/ee/issue.rb
ee/app/models/ee/issue.rb
+1
-0
ee/changelogs/unreleased/issue_211837.yml
ee/changelogs/unreleased/issue_211837.yml
+5
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+1
-0
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+6
-0
No files found.
db/post_migrate/20200406193427_add_index_to_issues_health_status.rb
0 → 100644
View file @
54477d44
# frozen_string_literal: true
class
AddIndexToIssuesHealthStatus
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'idx_issues_on_health_status_not_null'
disable_ddl_transaction!
def
up
add_concurrent_index
(
:issues
,
:health_status
,
where:
'health_status IS NOT NULL'
,
name:
INDEX_NAME
)
end
def
down
remove_concurrent_index_by_name
(
:issues
,
INDEX_NAME
)
end
end
db/structure.sql
View file @
54477d44
...
...
@@ -8585,6 +8585,8 @@ CREATE UNIQUE INDEX idx_environment_merge_requests_unique_index ON public.deploy
CREATE
INDEX
idx_geo_con_rep_updated_events_on_container_repository_id
ON
public
.
geo_container_repository_updated_events
USING
btree
(
container_repository_id
);
CREATE
INDEX
idx_issues_on_health_status_not_null
ON
public
.
issues
USING
btree
(
health_status
)
WHERE
(
health_status
IS
NOT
NULL
);
CREATE
INDEX
idx_issues_on_project_id_and_created_at_and_id_and_state_id
ON
public
.
issues
USING
btree
(
project_id
,
created_at
,
id
,
state_id
);
CREATE
INDEX
idx_issues_on_project_id_and_due_date_and_id_and_state_id
ON
public
.
issues
USING
btree
(
project_id
,
due_date
,
id
,
state_id
)
WHERE
(
due_date
IS
NOT
NULL
);
...
...
@@ -13147,6 +13149,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200406171857
20200406172135
20200406192059
20200406193427
20200407094005
20200407094923
20200408110856
...
...
doc/user/admin_area/settings/usage_statistics.md
View file @
54477d44
...
...
@@ -222,6 +222,7 @@ but commented out to help encourage others to add to it in the future. -->
|issues_with_associated_zoom_link|counts||
|issues_using_zoom_quick_actions|counts||
|issues_with_embedded_grafana_charts_approx|counts||
|issues_with_health_status|counts||
|keys|counts||
|label_lists|counts||
|lfs_objects|counts||
...
...
ee/app/models/ee/issue.rb
View file @
54477d44
...
...
@@ -27,6 +27,7 @@ module EE
end
scope
:on_status_page
,
->
{
joins
(
project: :status_page_setting
).
where
(
status_page_settings:
{
enabled:
true
}).
public_only
}
scope
:counts_by_health_status
,
->
{
reorder
(
nil
).
group
(
:health_status
).
count
}
scope
:with_health_status
,
->
{
where
.
not
(
health_status:
nil
)
}
has_one
:epic_issue
has_one
:epic
,
through: :epic_issue
...
...
ee/changelogs/unreleased/issue_211837.yml
0 → 100644
View file @
54477d44
---
title
:
Add health status counts to usage data
merge_request
:
28964
author
:
type
:
other
ee/lib/ee/gitlab/usage_data.rb
View file @
54477d44
...
...
@@ -147,6 +147,7 @@ module EE
feature_flags:
count
(
Operations
::
FeatureFlag
),
geo_nodes:
count
(
::
GeoNode
),
ldap_group_links:
count
(
::
LdapGroupLink
),
issues_with_health_status:
count
(
::
Issue
.
with_health_status
),
ldap_keys:
count
(
::
LDAPKey
),
ldap_users:
count
(
::
User
.
ldap
,
'users.id'
),
pod_logs_usages_total:
::
Gitlab
::
UsageCounters
::
PodLogs
.
usage_totals
[
:total
],
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
54477d44
...
...
@@ -38,6 +38,10 @@ describe Gitlab::UsageData do
create
(
:project_tracing_setting
,
project:
projects
[
0
])
create
(
:operations_feature_flag
,
project:
projects
[
0
])
create
(
:issue
,
project:
projects
[
1
])
create
(
:issue
,
health_status: :on_track
,
project:
projects
[
1
])
create
(
:issue
,
health_status: :at_risk
,
project:
projects
[
1
])
# for group_view testing
create
(
:user
)
# user with group_view = NULL (should be counted as having default value 'details')
create
(
:user
,
group_view: :details
)
...
...
@@ -83,6 +87,7 @@ describe Gitlab::UsageData do
epics_deepest_relationship_level
feature_flags
geo_nodes
issues_with_health_status
ldap_group_links
ldap_keys
ldap_users
...
...
@@ -116,6 +121,7 @@ describe Gitlab::UsageData do
expect
(
count_data
[
:feature_flags
]).
to
eq
(
1
)
expect
(
count_data
[
:status_page_projects
]).
to
eq
(
1
)
expect
(
count_data
[
:status_page_issues
]).
to
eq
(
1
)
expect
(
count_data
[
:issues_with_health_status
]).
to
eq
(
2
)
end
it
'has integer value for epic relationship level'
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