module NewRelic::Agent::Instrumentation::MonitoredThread::Chain

Public Class Methods

instrument!() click to toggle source
# File lib/new_relic/agent/instrumentation/thread/chain.rb, line 10
def self.instrument!
  ::Thread.class_eval do
    include NewRelic::Agent::Instrumentation::MonitoredThread

    alias_method(:initialize_without_new_relic, :initialize)

    def initialize(*args, &block)
      traced_block = add_thread_tracing(&block)
      initialize_with_newrelic_tracing { initialize_without_new_relic(*args, &traced_block) }
    end
  end
end
new(*args, &block) click to toggle source
# File lib/new_relic/agent/instrumentation/thread/chain.rb, line 16
def initialize(*args, &block)
  traced_block = add_thread_tracing(&block)
  initialize_with_newrelic_tracing { initialize_without_new_relic(*args, &traced_block) }
end