Mini profiler in Heroku?

A question is also asked on the miniprofiler forums.

Today I looked at the excellent railscast about the mount-mini-profiler gem, which is EXACTLY what I need now to identify some performance problems. Works great in dev, but I really need it in production, where the data is fully loaded.

I am not very versed in RACK, or much more than writing my own rail application and getting it to go. Today I included a mini-profiler in the project of our rails, and I need to make some performance corrections, and then put it into production. I also followed the instructions here http://samsaffron.com/archive/2012/07/12/miniprofiler-ruby-edition about enabling the filter before enabling and only enabling profiling if the user is in the appropriate administrator groups. Traced through code, and it works fine in dev.

In production, however, it is not included. I do not know if this is because:

  • I need to flip the magic bit elsewhere so that it says to be included in production
  • I need to do something strange in Heroku to make him play well, or
  • No hope.

Does anyone else use this gem in heroics and does it have feedback? In the meantime, I'm going to specify the dev system in production, but this also adds an extra delay.

+4
source share
1 answer

I used the Redis2Go addon for data storage and a slightly configured Gem for Redis connections due to the limitation for the free version of the addon.

The repo is available here ... https://github.com/mark-ellul/MiniProfiler

I added an initializer with the code below ...

uri = URI.parse(ENV["REDISTOGO_URL"]) Rack::MiniProfiler.config.storage_options = { :host => uri.host, :port => uri.port, :password => uri.password } Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore Rack::MiniProfiler.config.pre_authorize_cb = lambda { |env| true } 
+2
source

All Articles