Sha256: 3362ad07469ab1463c22cd80cb8d0b3f5565e2f26437ff555228818c97186518
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
require 'airbrake/rails/event' require 'airbrake/rails/app' module Airbrake module Rails # @return [String] CONTROLLER_KEY = 'controller'.freeze # @return [String] ACTION_KEY = 'action'.freeze # ActionControllerRouteSubscriber sends route stat information, including # performance data. # # @since v8.0.0 class ActionControllerRouteSubscriber def initialize @app = Airbrake::Rails::App.new end def call(*args) # We don't track routeless events. return unless (routes = Airbrake::Rack::RequestStore[:routes]) event = Airbrake::Rails::Event.new(*args) route = find_route(event.params) return unless route routes[route.path] = { method: event.method, response_type: event.response_type, groups: {} } end private def find_route(params) @app.routes.find do |route| route.controller == params[CONTROLLER_KEY] && route.action == params[ACTION_KEY] end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
airbrake-9.5.0 | lib/airbrake/rails/action_controller_route_subscriber.rb |
airbrake-9.4.5 | lib/airbrake/rails/action_controller_route_subscriber.rb |