Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 21:09:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 21:09:02 +0300
commit951616a26a61e880860ad862c1d45a8e3762b4bc (patch)
treeed6fe722e955aff38e13ca02d2aa7fdd4239c863 /lib/gitlab/profiler.rb
parente06d0e779673d745972863302858105aad9032e5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/profiler.rb')
-rw-r--r--lib/gitlab/profiler.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/gitlab/profiler.rb b/lib/gitlab/profiler.rb
index f47ccb8fed9..e10cdf0d8fb 100644
--- a/lib/gitlab/profiler.rb
+++ b/lib/gitlab/profiler.rb
@@ -2,6 +2,8 @@
module Gitlab
module Profiler
+ extend WithRequestStore
+
FILTERED_STRING = '[FILTERED]'
IGNORE_BACKTRACES = %w[
@@ -58,28 +60,26 @@ module Gitlab
logger = create_custom_logger(logger, private_token: private_token)
- RequestStore.begin!
-
- # Make an initial call for an asset path in development mode to avoid
- # sprockets dominating the profiler output.
- ActionController::Base.helpers.asset_path('katex.css') if Rails.env.development?
+ result = with_request_store do
+ # Make an initial call for an asset path in development mode to avoid
+ # sprockets dominating the profiler output.
+ ActionController::Base.helpers.asset_path('katex.css') if Rails.env.development?
- # Rails loads internationalization files lazily the first time a
- # translation is needed. Running this prevents this overhead from showing
- # up in profiles.
- ::I18n.t('.')[:test_string]
+ # Rails loads internationalization files lazily the first time a
+ # translation is needed. Running this prevents this overhead from showing
+ # up in profiles.
+ ::I18n.t('.')[:test_string]
- # Remove API route mounting from the profile.
- app.get('/api/v4/users')
+ # Remove API route mounting from the profile.
+ app.get('/api/v4/users')
- result = with_custom_logger(logger) do
- with_user(user) do
- RubyProf.profile { app.public_send(verb, url, params: post_data, headers: headers) } # rubocop:disable GitlabSecurity/PublicSend
+ with_custom_logger(logger) do
+ with_user(user) do
+ RubyProf.profile { app.public_send(verb, url, params: post_data, headers: headers) } # rubocop:disable GitlabSecurity/PublicSend
+ end
end
end
- RequestStore.end!
-
log_load_times_by_model(logger)
result