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
2fdc2449
Commit
2fdc2449
authored
Jun 01, 2020
by
Amparo Luna
Committed by
Mayra Cabrera
Jun 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add individual usage counters for snippet types
parent
7c065e6b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
0 deletions
+29
-0
changelogs/unreleased/al-215200-snippets-by-type-usage-counter.yml
...s/unreleased/al-215200-snippets-by-type-usage-counter.yml
+5
-0
db/migrate/20200522235146_add_index_on_snippet_type_and_id.rb
...igrate/20200522235146_add_index_on_snippet_type_and_id.rb
+17
-0
db/structure.sql
db/structure.sql
+3
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+2
-0
spec/support/helpers/usage_data_helpers.rb
spec/support/helpers/usage_data_helpers.rb
+2
-0
No files found.
changelogs/unreleased/al-215200-snippets-by-type-usage-counter.yml
0 → 100644
View file @
2fdc2449
---
title
:
Add index on id and type for Snippets
merge_request
:
32885
author
:
type
:
performance
db/migrate/20200522235146_add_index_on_snippet_type_and_id.rb
0 → 100644
View file @
2fdc2449
# frozen_string_literal: true
class
AddIndexOnSnippetTypeAndId
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
:snippets
,
[
:id
,
:type
]
end
def
down
remove_concurrent_index
:snippets
,
[
:id
,
:type
]
end
end
db/structure.sql
View file @
2fdc2449
...
...
@@ -10744,6 +10744,8 @@ CREATE INDEX index_snippets_on_description_trigram ON public.snippets USING gin
CREATE
INDEX
index_snippets_on_file_name_trigram
ON
public
.
snippets
USING
gin
(
file_name
public
.
gin_trgm_ops
);
CREATE
INDEX
index_snippets_on_id_and_type
ON
public
.
snippets
USING
btree
(
id
,
type
);
CREATE
INDEX
index_snippets_on_project_id_and_visibility_level
ON
public
.
snippets
USING
btree
(
project_id
,
visibility_level
);
CREATE
INDEX
index_snippets_on_title_trigram
ON
public
.
snippets
USING
gin
(
title
public
.
gin_trgm_ops
);
...
...
@@ -14024,6 +14026,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200521225327
20200521225337
20200521225346
20200522235146
20200525114553
20200525121014
20200526000407
...
...
lib/gitlab/usage_data.rb
View file @
2fdc2449
...
...
@@ -133,6 +133,8 @@ module Gitlab
releases:
count
(
Release
),
remote_mirrors:
count
(
RemoteMirror
),
snippets:
count
(
Snippet
),
personal_snippets:
count
(
PersonalSnippet
),
project_snippets:
count
(
ProjectSnippet
),
suggestions:
count
(
Suggestion
),
terraform_reports:
count
(
::
Ci
::
JobArtifact
.
terraform_reports
),
terraform_states:
count
(
::
Terraform
::
State
),
...
...
spec/support/helpers/usage_data_helpers.rb
View file @
2fdc2449
...
...
@@ -124,6 +124,8 @@ module UsageDataHelpers
releases
remote_mirrors
snippets
personal_snippets
project_snippets
suggestions
terraform_reports
terraform_states
...
...
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