Sha256: dbdfb524b6fcd0af699fe4653cd3a4af5463c535968dff169bae53377f19400c

Contents?: true

Size: 732 Bytes

Versions: 16

Compression:

Stored size: 732 Bytes

Contents

module Airbrake
  module Rack
    # Instrumentable holds methods that simplify instrumenting Rack apps.
    # @example
    #   class UsersController
    #     extend Airbrake::Rack::Instrumentable
    #
    #     def index
    #       # ...
    #     end
    #     airbrake_capture_timing :index
    #   end
    #
    # @api public
    # @since v9.2.0
    module Instrumentable
      def airbrake_capture_timing(method_name, label: method_name.to_s)
        alias_method "#{method_name}_without_airbrake", method_name

        define_method(method_name) do |*args|
          Airbrake::Rack.capture_timing(label) do
            __send__("#{method_name}_without_airbrake", *args)
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
airbrake-10.0.0 lib/airbrake/rack/instrumentable.rb
airbrake-9.5.5 lib/airbrake/rack/instrumentable.rb
airbrake-9.5.4 lib/airbrake/rack/instrumentable.rb
airbrake-9.5.3 lib/airbrake/rack/instrumentable.rb
airbrake-9.5.2 lib/airbrake/rack/instrumentable.rb
airbrake-9.5.1 lib/airbrake/rack/instrumentable.rb
airbrake-9.5.0 lib/airbrake/rack/instrumentable.rb
airbrake-9.4.5 lib/airbrake/rack/instrumentable.rb
airbrake-9.4.4 lib/airbrake/rack/instrumentable.rb
airbrake-9.4.3 lib/airbrake/rack/instrumentable.rb
airbrake-9.4.2 lib/airbrake/rack/instrumentable.rb
airbrake-9.4.1 lib/airbrake/rack/instrumentable.rb
airbrake-9.4.0 lib/airbrake/rack/instrumentable.rb
airbrake-9.3.0 lib/airbrake/rack/instrumentable.rb
airbrake-9.2.2 lib/airbrake/rack/instrumentable.rb
airbrake-9.2.1 lib/airbrake/rack/instrumentable.rb