Class: Airbrake::Rails::ActionControllerRouteSubscriber

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

Overview

ActionControllerRouteSubscriber 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



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

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

  # We don't track routeless events.
  return unless (routes = Airbrake::Rack::RequestStore[:routes])

  event = Airbrake::Rails::Event.new(*args)
  route = Airbrake::Rails::App.recognize_route(
    Airbrake::Rack::RequestStore[:request],
  )
  return unless route

  routes[route.path] = {
    method: event.method,
    response_type: event.response_type,
    groups: {},
  }
end