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:
Yorick Peterse 2015-11-09 15:54:13 +01:00
parent 26344c8f82
commit 73cf0f1647
2 changed files with 2 additions and 1 deletions

View file

@ -1,5 +1,4 @@
require 'securerandom'
require 'rblineprof' if RUBY_ENGINE == 'ruby'
module Gitlab
module Sherlock

View file

@ -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 }