module ElasticAPM::Spies
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
@api private
Public Class Methods
hook_into(name)
click to toggle source
# File lib/elastic_apm/spies.rb, line 85 def self.hook_into(name) return unless (registration = require_hooks[name]) return unless safe_defined?(registration.const_name) installed[registration.const_name] = registration registration.install registration.require_paths.each do |path| require_hooks.delete path end end
installed()
click to toggle source
# File lib/elastic_apm/spies.rb, line 44 def self.installed @installed ||= {} end
register(*args)
click to toggle source
# File lib/elastic_apm/spies.rb, line 48 def self.register(*args) registration = Registration.new(*args) if safe_defined?(registration.const_name) registration.install installed[registration.const_name] = registration else register_require_hook registration end end
register_require_hook(registration)
click to toggle source
# File lib/elastic_apm/spies.rb, line 79 def self.register_require_hook(registration) registration.require_paths.each do |path| require_hooks[path] = registration end end
require_hooks()
click to toggle source
# File lib/elastic_apm/spies.rb, line 40 def self.require_hooks @require_hooks ||= {} end
safe_defined?(const_name)
click to toggle source
# File lib/elastic_apm/spies.rb, line 97 def self.safe_defined?(const_name) Util::Inflector.safe_constantize(const_name) end
without_faraday() { || ... }
click to toggle source
# File lib/elastic_apm/spies.rb, line 59 def self.without_faraday return yield unless defined?(FaradaySpy) # rubocop:disable Style/ExplicitBlockArgument ElasticAPM::Spies::FaradaySpy.disable_in do yield end # rubocop:enable Style/ExplicitBlockArgument end
without_net_http() { || ... }
click to toggle source
# File lib/elastic_apm/spies.rb, line 69 def self.without_net_http return yield unless defined?(NetHTTPSpy) # rubocop:disable Style/ExplicitBlockArgument ElasticAPM::Spies::NetHTTPSpy.disable_in do yield end # rubocop:enable Style/ExplicitBlockArgument end
Public Instance Methods
install()
click to toggle source
# File lib/elastic_apm/spies/racecar.rb, line 66 def install ConsumerSubscriber.attach_to(:racecar) ProducerSubscriber.attach_to(:racecar) end