diff --git a/Gemfile b/Gemfile index e01bd56a077..0d3238ae880 100644 --- a/Gemfile +++ b/Gemfile @@ -193,6 +193,7 @@ gem 'rack-mini-profiler', git: 'https://github.com/MiniProfiler/rack-mini-profi gem 'rack-cors', require: false gem 'unicorn', require: false gem 'puma', require: false +gem 'rbtrace', require: false # perftools only works on 1.9 atm group :profile do diff --git a/Gemfile_rails4.lock b/Gemfile_rails4.lock index 0bc1971fedd..032e1e4ba7b 100644 --- a/Gemfile_rails4.lock +++ b/Gemfile_rails4.lock @@ -246,6 +246,7 @@ GEM mocha (0.14.0) metaclass (~> 0.0.1) mock_redis (0.9.0) + msgpack (0.5.6) multi_json (1.8.2) multipart-post (1.2.0) mustache (0.99.4) @@ -336,6 +337,10 @@ GEM rb-fsevent (0.9.3) rb-inotify (0.9.2) ffi (>= 0.5.0) + rbtrace (0.4.1) + ffi (>= 1.0.6) + msgpack (>= 0.4.3) + trollop (>= 1.16.2) redcarpet (3.0.0) redis (3.0.5) redis-actionpack (4.0.0) @@ -441,6 +446,7 @@ GEM treetop (1.4.15) polyglot polyglot (>= 0.3.1) + trollop (2.0) tzinfo (0.3.38) uglifier (2.2.1) execjs (>= 0.3.0) @@ -516,6 +522,7 @@ DEPENDENCIES rake rb-fsevent rb-inotify (~> 0.9) + rbtrace redcarpet redis redis-rails! diff --git a/config/application.rb b/config/application.rb index 5bc51eefc68..51896ddaa73 100644 --- a/config/application.rb +++ b/config/application.rb @@ -151,5 +151,9 @@ module Discourse # absolutly no spot in our app were we use XML as opposed to JSON endpoints ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML) + if ENV['RBTRACE'] == "1" + require 'rbtrace' + end + end end