How to Monitor Performance in a Rails Application

Feature thumb snip20170626 43

The Rack Mini Profiler gem is a great option for monitoring performance in a Rails application. The installation instructions are below:

Gems to Install

Add the following to your Gemfile and run bundle install:

Create an Initializer

Create a new initializer file here: config/initializers/rack_profiler.rb and add the following code to it:

Now as you navigate the application in development you can click on the status bar on the top left hand side and view the performance statistics:

Additionally, if you want to graph a page's performance, you can append the following to the URL: ?pp=flamegraph and you will get a chart like this: