I'm using rack-mini-profiler after watching it's railscast (http://railscasts.com/episodes/368-miniprofiler).
I added it to my Gemfile:
gem 'rack-mini-profiler'
Installed it using bundler and started my dev environment using "rails s". The profilling works, it shows up at the left upper corner of the web page, but it happens to profile all the static files (js, css, images, etc). It also seems that it has a limit of 10 lines, so the actual request is hidden.
Is it possible to configure it so it will avoid profiling static files?
Skip, disable and enable the Rack Mini Profiler Entering a query with pp=skip prevents it from loading for a single page load. You can reload it by going back with your browser. To turn the profiler off, use disable. So, http://localhost:3000/articles?pp=disable would disable the profiler until it was re-enabled.
MiniProfiler is a library and UI for profiling your application. By letting you see where your time is spent, which queries are run, and any other custom timings you want to add, MiniProfiler helps you debug issues and optimize performance.
Ok, here's how I have done it:
Used the 0.0.18 version of the gem (which is not on rubygems.org, you'll have to install it from the project's git repo) and created a config file at /config/initializers/miniprofiler.rb:
Rack::MiniProfiler.config.skip_paths << "/images/"
Rack::MiniProfiler.config.skip_paths << "/stylesheets/"
Rack::MiniProfiler.config.skip_paths << "/javascripts/"
Rack::MiniProfiler.config.skip_paths << "/favicon.ico"
That did the trick
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With