Module: Contrast::Agent::TracePointHook

Includes:
Components::Interface
Defined in:
lib/contrast/agent/tracepoint_hook.rb

Overview

This module is used to apply instrumentation to classes as they are required

Class Method Summary collapse

Methods included from Components::Interface

included

Class Method Details

.disableObject



24
25
26
# File 'lib/contrast/agent/tracepoint_hook.rb', line 24

def disable
  instance_variable_defined?(:@require_hook) && @require_hook.disable
end

.enable!Object



15
16
17
18
19
20
21
22
# File 'lib/contrast/agent/tracepoint_hook.rb', line 15

def enable!
  @require_hook ||= TracePoint.new(:end) do |tracepoint_event|
    process(tracepoint_event)
  end

  @require_hook.enable
  logger.debug('Enabled :end event tracing')
end