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
7475402e
Commit
7475402e
authored
Sep 30, 2020
by
Sean Arnold
Committed by
Adam Hegyi
Sep 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index for project_id on incident issue type
- Update schema
parent
c60be175
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
0 deletions
+30
-0
changelogs/unreleased/233719-project-creating-incidents-usage-ping.yml
...released/233719-project-creating-incidents-usage-ping.yml
+5
-0
db/migrate/20200927224750_add_incident_issue_type_index_to_issues.rb
...20200927224750_add_incident_issue_type_index_to_issues.rb
+20
-0
db/schema_migrations/20200927224750
db/schema_migrations/20200927224750
+1
-0
db/structure.sql
db/structure.sql
+2
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+1
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+1
-0
No files found.
changelogs/unreleased/233719-project-creating-incidents-usage-ping.yml
0 → 100644
View file @
7475402e
---
title
:
Add projects_creating_incidents to usage ping counts
merge_request
:
42934
author
:
type
:
added
db/migrate/20200927224750_add_incident_issue_type_index_to_issues.rb
0 → 100644
View file @
7475402e
# frozen_string_literal: true
class
AddIncidentIssueTypeIndexToIssues
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
INCIDENT_ISSUE_TYPE
=
1
INDEX_NAME
=
'index_issues_project_id_issue_type_incident'
def
up
add_concurrent_index
:issues
,
:project_id
,
where:
"issue_type =
#{
INCIDENT_ISSUE_TYPE
}
"
,
name:
INDEX_NAME
end
def
down
remove_concurrent_index_by_name
(
:issues
,
INDEX_NAME
)
end
end
db/schema_migrations/20200927224750
0 → 100644
View file @
7475402e
8e0c5be3d6fe2d0d718c7b7a99d84b14dfc6006f780ec0622eb5aae937e6b367
\ No newline at end of file
db/structure.sql
View file @
7475402e
...
...
@@ -20372,6 +20372,8 @@ CREATE INDEX index_issues_on_updated_at ON issues USING btree (updated_at);
CREATE
INDEX
index_issues_on_updated_by_id
ON
issues
USING
btree
(
updated_by_id
)
WHERE
(
updated_by_id
IS
NOT
NULL
);
CREATE
INDEX
index_issues_project_id_issue_type_incident
ON
issues
USING
btree
(
project_id
)
WHERE
(
issue_type
=
1
);
CREATE
UNIQUE
INDEX
index_jira_connect_installations_on_client_key
ON
jira_connect_installations
USING
btree
(
client_key
);
CREATE
INDEX
index_jira_connect_subscriptions_on_namespace_id
ON
jira_connect_subscriptions
USING
btree
(
namespace_id
);
...
...
lib/gitlab/usage_data.rb
View file @
7475402e
...
...
@@ -138,6 +138,7 @@ module Gitlab
pages_domains:
count
(
PagesDomain
),
pool_repositories:
count
(
PoolRepository
),
projects:
count
(
Project
),
projects_creating_incidents:
distinct_count
(
Issue
.
incident
,
:project_id
),
projects_imported_from_github:
count
(
Project
.
where
(
import_type:
'github'
)),
projects_with_repositories_enabled:
count
(
ProjectFeature
.
where
(
'repository_access_level > ?'
,
ProjectFeature
::
DISABLED
)),
projects_with_error_tracking_enabled:
count
(
::
ErrorTracking
::
ProjectErrorTrackingSetting
.
where
(
enabled:
true
)),
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
7475402e
...
...
@@ -497,6 +497,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect
(
count_data
[
:personal_snippets
]).
to
eq
(
2
)
expect
(
count_data
[
:project_snippets
]).
to
eq
(
4
)
expect
(
count_data
[
:projects_creating_incidents
]).
to
eq
(
2
)
expect
(
count_data
[
:projects_with_packages
]).
to
eq
(
2
)
expect
(
count_data
[
:packages
]).
to
eq
(
4
)
expect
(
count_data
[
:user_preferences_user_gitpod_enabled
]).
to
eq
(
1
)
...
...
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