Sha256: 6141f0a7fecfb4c266079d95666f17a07e29b1397d3ce482e19f48814cbf4642

Contents?: true

Size: 817 Bytes

Versions: 4

Compression:

Stored size: 817 Bytes

Contents

require_relative './rails/middleware.rb'
require_relative './models/collection.rb'
require_relative './instrument/metrics_collector.rb'

module RailsPerformance
  class Engine < ::Rails::Engine

    if RailsPerformance.enabled
      config.app_middleware.insert_after ActionDispatch::Executor, RailsPerformance::Rails::Middleware
      initializer :configure_metrics, after: :initialize_logger do
        ActiveSupport::Notifications.subscribe(
          "process_action.action_controller",
          RailsPerformance::Instrument::MetricsCollector.new
        )

        config.after_initialize do |app|
          ActionView::LogSubscriber.send :prepend, RailsPerformance::Extensions::View
          ActiveRecord::LogSubscriber.send :prepend, RailsPerformance::Extensions::Db
        end
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_performance-0.0.1.19 lib/rails_performance/engine.rb
rails_performance-0.0.1.18 lib/rails_performance/engine.rb
rails_performance-0.0.1.17 lib/rails_performance/engine.rb
rails_performance-0.0.1.16 lib/rails_performance/engine.rb