Sha256: 667a56ae550f4b3f96d75e85e572c73f93d658d5967a34573266a08a43cb6824

Contents?: true

Size: 1.03 KB

Versions: 26

Compression:

Stored size: 1.03 KB

Contents

module Honeybadger
  module Monitor
    class Railtie < ::Rails::Railtie

      config.after_initialize do
        if Honeybadger.configuration.metrics?

          ActiveSupport::Notifications.subscribe('process_action.action_controller') do |*args|
            event = ActiveSupport::Notifications::Event.new(*args)
            status = event.payload[:exception] ? 500 : event.payload[:status]
            Monitor.worker.timing("app.request.#{status}", event.duration)

            controller = event.payload[:controller]
            action = event.payload[:action]
            if controller && action
              Monitor.worker.timing("app.controller.#{controller}.#{action}.total", event.duration)
              Monitor.worker.timing("app.controller.#{controller}.#{action}.view", event.payload[:view_runtime]) if event.payload[:view_runtime]
              Monitor.worker.timing("app.controller.#{controller}.#{action}.db", event.payload[:db_runtime]) if event.payload[:db_runtime]
            end
          end

        end
      end

    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
honeybadger-1.14.0 lib/honeybadger/monitor/railtie.rb
honeybadger-1.13.2 lib/honeybadger/monitor/railtie.rb
honeybadger-1.13.1 lib/honeybadger/monitor/railtie.rb
honeybadger-1.13.0 lib/honeybadger/monitor/railtie.rb
honeybadger-1.12.0.beta3 lib/honeybadger/monitor/railtie.rb
honeybadger-1.12.0.beta2 lib/honeybadger/monitor/railtie.rb
honeybadger-1.11.2 lib/honeybadger/monitor/railtie.rb
honeybadger-1.11.1 lib/honeybadger/monitor/railtie.rb
honeybadger-1.11.0 lib/honeybadger/monitor/railtie.rb
honeybadger-1.10.3 lib/honeybadger/monitor/railtie.rb
honeybadger-1.11.0.beta4 lib/honeybadger/monitor/railtie.rb
honeybadger-1.11.0.beta3 lib/honeybadger/monitor/railtie.rb
honeybadger-1.11.0.beta2 lib/honeybadger/monitor/railtie.rb
honeybadger-1.10.2 lib/honeybadger/monitor/railtie.rb
honeybadger-1.11.0.beta1 lib/honeybadger/monitor/railtie.rb
honeybadger-1.10.1 lib/honeybadger/monitor/railtie.rb
honeybadger-1.10.0 lib/honeybadger/monitor/railtie.rb
honeybadger-1.9.5 lib/honeybadger/monitor/railtie.rb
honeybadger-1.10.0.beta2 lib/honeybadger/monitor/railtie.rb
honeybadger-1.10.0.beta1 lib/honeybadger/monitor/railtie.rb