Module: AllscriptsUnityClient::NewRelicSupport

Defined in:
lib/allscripts_unity_client/new_relic_support.rb

Class Method Summary collapse

Class Method Details

.enable_method_tracer(instance) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/allscripts_unity_client/new_relic_support.rb', line 3

def self.enable_method_tracer(instance)
  class << instance
    if !respond_to?(:trace_execution_scoped) && !respond_to?(:add_method_tracer)
      extend ::NewRelic::Agent::MethodTracer
    end
  end
end

.trace_execution_scoped_if_available(klass, scope) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/allscripts_unity_client/new_relic_support.rb', line 11

def self.trace_execution_scoped_if_available(klass, scope)
  if klass.respond_to?(:trace_execution_scoped)
    klass.trace_execution_scoped(scope, &Proc.new)
  else
    yield if block_given?
  end
end