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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
1d50b6a4
Commit
1d50b6a4
authored
Jun 11, 2018
by
Kim Carlbäcker
Committed by
Sean McGivern
Jun 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate CycleAnalytics::CommitCount to Gitaly
parent
a20d3ff2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
lib/gitlab/cycle_analytics/summary/commit.rb
lib/gitlab/cycle_analytics/summary/commit.rb
+5
-15
No files found.
lib/gitlab/cycle_analytics/summary/commit.rb
View file @
1d50b6a4
...
...
@@ -7,10 +7,8 @@ module Gitlab
end
def
value
Gitlab
::
GitalyClient
::
StorageSettings
.
allow_disk_access
do
@value
||=
count_commits
end
end
private
...
...
@@ -21,19 +19,11 @@ module Gitlab
def
count_commits
return
unless
ref
repository
=
@project
.
repository
.
raw_repository
sha
=
@project
.
repository
.
commit
(
ref
).
sha
cmd
=
%W(git --git-dir=
#{
repository
.
path
}
log)
cmd
<<
'--format=%H'
cmd
<<
"--after=
#{
@from
.
iso8601
}
"
cmd
<<
sha
output
,
status
=
Gitlab
::
Popen
.
popen
(
cmd
)
raise
IOError
,
output
unless
status
.
zero?
gitaly_commit_client
.
commit_count
(
ref
,
after:
@from
)
end
output
.
lines
.
count
def
gitaly_commit_client
Gitlab
::
GitalyClient
::
CommitService
.
new
(
@project
.
repository
.
raw_repository
)
end
def
ref
...
...
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