Class: Airbrake::Rails::ActionControllerNotifySubscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/airbrake/rails/action_controller_notify_subscriber.rb

Overview

ActionControllerNotifySubscriber sends route stat information, including performance data.

Since:

  • v8.0.0

Instance Method Summary collapse

Instance Method Details

#call(*args) ⇒ Object

Since:

  • v8.0.0



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/airbrake/rails/action_controller_notify_subscriber.rb', line 12

def call(*args)
  return unless Airbrake::Config.instance.performance_stats

  routes = Airbrake::Rack::RequestStore[:routes]
  return if !routes || routes.none?

  event = Airbrake::Rails::Event.new(*args)

  routes.each do |route, _params|
    Airbrake.notify_request(
      method: event.method,
      route: route,
      status_code: event.status_code,
      timing: event.duration,
      time: event.time,
    )
  end
end