Module: TraceView::Ruby

Defined in:
lib/traceview/ruby.rb

Overview

This module provides a method to manually initialize the Ruby instrumentation. Normally this is done by detecting frameworks at load time and inserting initialization hooks.

Class Method Summary collapse

Class Method Details

.initializeObject



11
12
13
# File 'lib/traceview/ruby.rb', line 11

def initialize
  load
end

.loadObject

The core method to load Ruby instrumentation. Call this from raw Ruby scripts or in Ruby applications where a supported framework isn’t being used. Supported frameworks will instead be detected at load time and initialization is automatic.



21
22
23
24
25
26
27
28
29
# File 'lib/traceview/ruby.rb', line 21

def load
  # In case some apps call this manually, make sure
  # that the gem is fully loaded and not in no-op
  # mode (e.g. on unsupported platforms etc.)
  if TraceView.loaded
    TraceView::Loading.load_access_key
    TraceView::Inst.load_instrumentation
  end
end