Commit 73cf0f16 authored by Yorick Peterse's avatar Yorick Peterse

Only load rblineprof when actually needed

This ensures the application can still boot when the "development" group
is not available.
parent 26344c8f
require 'securerandom' require 'securerandom'
require 'rblineprof' if RUBY_ENGINE == 'ruby'
module Gitlab module Gitlab
module Sherlock module Sherlock
......
...@@ -40,6 +40,8 @@ module Gitlab ...@@ -40,6 +40,8 @@ module Gitlab
# Profiles the given block using rblineprof (MRI only). # Profiles the given block using rblineprof (MRI only).
def profile_mri def profile_mri
require 'rblineprof'
retval = nil retval = nil
samples = lineprof(/^#{Rails.root.to_s}/) { retval = yield } samples = lineprof(/^#{Rails.root.to_s}/) { retval = yield }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment