summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-06-18 09:02:42 +0000
committerRémy Coutable <remy@rymai.me>2018-06-18 09:02:42 +0000
commit2a82179e102159b8416f4a20d3349ef208c58738 (patch)
treebe02157c95789808a4a7a5180db6217af6af1684 /lib
parent99fdbe4c230205510e1d7061e68bb1a003913d4b (diff)
parentd304f883520277334339bf2be1dd20c53a51dc16 (diff)
downloadgitlab-ce-2a82179e102159b8416f4a20d3349ef208c58738.tar.gz
Merge branch 'expose-clean-backtrace-method-from-profiler' into 'master'
Expose a clean_backtrace method from Gitlab::Profiler See merge request gitlab-org/gitlab-ce!19894
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/profiler.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/gitlab/profiler.rb b/lib/gitlab/profiler.rb
index 18540e64d4c..ecff6ab5d5e 100644
--- a/lib/gitlab/profiler.rb
+++ b/lib/gitlab/profiler.rb
@@ -11,6 +11,7 @@ module Gitlab
lib/gitlab/etag_caching/
lib/gitlab/metrics/
lib/gitlab/middleware/
+ ee/lib/gitlab/middleware/
lib/gitlab/performance_bar/
lib/gitlab/request_profiler/
lib/gitlab/profiler.rb
@@ -98,11 +99,7 @@ module Gitlab
super
- backtrace = Rails.backtrace_cleaner.clean(caller)
-
- backtrace.each do |caller_line|
- next if caller_line.match(Regexp.union(IGNORE_BACKTRACES))
-
+ Gitlab::Profiler.clean_backtrace(caller).each do |caller_line|
stripped_caller_line = caller_line.sub("#{Rails.root}/", '')
super(" ↳ #{stripped_caller_line}")
@@ -112,6 +109,12 @@ module Gitlab
end
end
+ def self.clean_backtrace(backtrace)
+ Array(Rails.backtrace_cleaner.clean(backtrace)).reject do |line|
+ line.match(Regexp.union(IGNORE_BACKTRACES))
+ end
+ end
+
def self.with_custom_logger(logger)
original_colorize_logging = ActiveSupport::LogSubscriber.colorize_logging
original_activerecord_logger = ActiveRecord::Base.logger