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
d2da1dbe
Commit
d2da1dbe
authored
Mar 07, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce one additional thread into bin/elastic_repo_indexer
parent
44a45d87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
bin/elastic_repo_indexer
bin/elastic_repo_indexer
+14
-8
changelogs/unreleased-ee/1606-parallelise-elastic_repo_indexer.yml
...s/unreleased-ee/1606-parallelise-elastic_repo_indexer.yml
+4
-0
No files found.
bin/elastic_repo_indexer
View file @
d2da1dbe
...
...
@@ -10,6 +10,8 @@ require 'benchmark'
require
File
.
expand_path
(
'../lib/gitlab/elastic/client'
,
File
.
dirname
(
__FILE__
))
Thread
.
abort_on_exception
=
true
path_to_log_file
=
File
.
expand_path
(
'../log/es-indexer.log'
,
File
.
dirname
(
__FILE__
))
LOGGER
=
Logger
.
new
(
path_to_log_file
)
...
...
@@ -56,17 +58,19 @@ repo = Repository.new
params
=
{
from_rev:
FROM_SHA
,
to_rev:
TO_SHA
}.
compact
LOGGER
.
info
(
"Indexing commits started"
)
commit_thr
=
Thread
.
new
do
LOGGER
.
info
(
"Indexing commits started"
)
timings
=
Benchmark
.
measure
do
indexed
=
0
repo
.
index_commits
(
params
)
do
|
batch
,
total_count
|
indexed
+=
batch
.
length
LOGGER
.
info
(
"Indexed
#{
indexed
}
/
#{
total_count
}
commits"
)
timings
=
Benchmark
.
measure
do
indexed
=
0
repo
.
index_commits
(
params
)
do
|
batch
,
total_count
|
indexed
+=
batch
.
length
LOGGER
.
info
(
"Indexed
#{
indexed
}
/
#{
total_count
}
commits"
)
end
end
end
LOGGER
.
info
(
"Commits for
#{
REPO_PATH
}
are indexed. Time elapsed:
#{
timings
.
real
}
"
)
LOGGER
.
info
(
"Commits for
#{
REPO_PATH
}
are indexed. Time elapsed:
#{
timings
.
real
}
"
)
end
LOGGER
.
info
(
"Indexing blobs started"
)
...
...
@@ -79,3 +83,5 @@ timings = Benchmark.measure do
end
LOGGER
.
info
(
"Blobs for
#{
REPO_PATH
}
are indexed. Time elapsed:
#{
timings
.
real
}
"
)
commit_thr
.
join
changelogs/unreleased-ee/1606-parallelise-elastic_repo_indexer.yml
0 → 100644
View file @
d2da1dbe
---
title
:
Introduce one additional thread into bin/elastic_repo_indexer
merge_request
:
1372
author
:
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