summaryrefslogtreecommitdiff
path: root/lib/gitlab_shell.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r--lib/gitlab_shell.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index f72ce74..ad2cc50 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -2,6 +2,7 @@ require 'shellwords'
require 'pathname'
require_relative 'gitlab_net'
+require_relative 'gitlab_metrics'
class GitlabShell
class AccessDeniedError < StandardError; end
@@ -32,7 +33,9 @@ class GitlabShell
args = Shellwords.shellwords(origin_cmd)
parse_cmd(args)
- verify_access if GIT_COMMANDS.include?(args.first)
+ if GIT_COMMANDS.include?(args.first)
+ GitlabMetrics.measure('verify_access') { verify_access }
+ end
process_cmd(args)
@@ -118,11 +121,11 @@ class GitlabShell
$logger.info "gitlab-shell: executing git-annex command <#{parsed_args.join(' ')}> for #{log_username}."
exec_cmd(*parsed_args)
-
elsif @command == 'git-lfs-authenticate'
- $logger.info "gitlab-shell: Processing LFS authentication for #{log_username}."
- lfs_authenticate
-
+ GitlabMetrics.measure('lfs_authenticate') do
+ $logger.info "gitlab-shell: Processing LFS authentication for #{log_username}."
+ lfs_authenticate
+ end
else
$logger.info "gitlab-shell: executing git command <#{@command} #{repo_path}> for #{log_username}."
exec_cmd(@command, repo_path)