Only load rblineprof when actually needed
This ensures the application can still boot when the "development" group is not available.
This commit is contained in:
parent
26344c8f82
commit
73cf0f1647
2 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,4 @@
|
|||
require 'securerandom'
|
||||
require 'rblineprof' if RUBY_ENGINE == 'ruby'
|
||||
|
||||
module Gitlab
|
||||
module Sherlock
|
||||
|
|
|
@ -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 }
|
||||
|
||||
|
|
Loading…
Reference in a new issue