The project is in a healthy, maintained state
Database-backed modest performance monitoring tool for your Rails app.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 7.1.5
>= 9.3.1
>= 7.1.5
>= 4.2.1
 Project Readme

☯️ InnerPerformance Gem Version

Database-backed modest performance monitoring tool for your Rails app.

image

Installation

Add inner_performance gem to your bundle

$ bundle add inner_performance

Install migrations

$ rails inner_performance:install:migrations
$ rails db:migrate

Add inner_performance to app/assets/config/manifest.js

//= link inner_performance/application.css

Mount UI in routes.rb (don't forget to protect it!)

mount InnerPerformance::Engine, at: '/inner_performance'

Configuration

inner_performance comes with some good defaults but in order to customize them, you have a following options available:

InnerPerformance.configure do |config|
  config.sample_rates = {
    # 2% of all the requests will be stored and analyzed. I would
    # recommend keeping it low because otherwise your database will
    # get full of events quite fast. It will also probably impact
    # your app's performance. As an example: In a Spree shop with
    # approx. 170 requests per minute, keeping it at default 2%
    # provides me more than enough data to analyze and locate the
    # bottlenecks.
    'process_action.action_controller' => (Rails.env.production? ? 2 : 100),

    # 100% of all the jobs will be stored and analyzed.
    'perform.active_job' => 100
  }

  # For how long events should be stored. All the ones that exceeds
  # this limit will be cleared out by InnerPerformance::CleanupJob.
  config.events_retention = 1.week

  # Used mostly by UI. Tells the UI what's the middle range when it
  # comes to event duration. For the example below, all the durations
  # between 0 and 200ms will be considered fast, all the ones between
  # 200ms and 999ms will be considered medium and all above 999ms will
  # be considered slow.
  config.medium_duration_range = [200, 999]

  # Rules for ignoring an event. There are two rules applied by default:
  # * sample_rates - operates on configured sample rate and drops events
  #   which do not got lucky when drawing a random number
  # * InnerPerformance job namespace - we don't want to save events for
  #   the job that saves the events because that leeds to infinite loop.
  #   Better not remove this rule as it will lead to stack overflow.
  config.ignore_rules.push(
    proc { |event| !event.is_a?(ActiveSupport::Notifications::Event) }
  )
end

Regular Housekeeping

To ensure optimal performance and avoid data bloat, remember to schedule the cleanup job:

InnerPerformance::CleanupJob.perform_later

Alternatives

License

The gem is available as open source under the terms of the MIT License.