diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2015-11-09 17:54:13 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2015-11-09 17:54:13 +0300 |
commit | 73cf0f1647806a4ce064707c6f1f416181de48ef (patch) | |
tree | d260d48936ce47d776f6c22a416afe5090c1cf17 /lib | |
parent | 26344c8f82c06a4d9cc65760bc8f2764a55a338b (diff) |
Only load rblineprof when actually needed
This ensures the application can still boot when the "development" group
is not available.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/sherlock.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/sherlock/line_profiler.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitlab/sherlock.rb b/lib/gitlab/sherlock.rb index c4b35b24ceb..6360527a7aa 100644 --- a/lib/gitlab/sherlock.rb +++ b/lib/gitlab/sherlock.rb @@ -1,5 +1,4 @@ require 'securerandom' -require 'rblineprof' if RUBY_ENGINE == 'ruby' module Gitlab module Sherlock diff --git a/lib/gitlab/sherlock/line_profiler.rb b/lib/gitlab/sherlock/line_profiler.rb index 152749dcc39..aa1468bff6b 100644 --- a/lib/gitlab/sherlock/line_profiler.rb +++ b/lib/gitlab/sherlock/line_profiler.rb @@ -40,6 +40,8 @@ module Gitlab # Profiles the given block using rblineprof (MRI only). def profile_mri + require 'rblineprof' + retval = nil samples = lineprof(/^#{Rails.root.to_s}/) { retval = yield } |