class StaticTracing::Configuration

Attributes

mode[R]
signal[R]

Public Class Methods

instance() click to toggle source
# File lib/ruby-static-tracing/configuration.rb, line 16
def instance
  @instance ||= new
end
new() click to toggle source

A new configuration instance

# File lib/ruby-static-tracing/configuration.rb, line 24
def initialize
  @mode = Modes::SIGNAL
  @signal = Modes::SIGNALS::SIGPROF
  enable_trap
end

Public Instance Methods

add_tracer(tracer) click to toggle source

Adds a new tracer globally

# File lib/ruby-static-tracing/configuration.rb, line 47
def add_tracer(tracer)
  Tracers.add(tracer)
end
mode=(new_mode) click to toggle source

Sets the mode [ON, OFF, SIGNAL] Default is SIGNAL

# File lib/ruby-static-tracing/configuration.rb, line 32
def mode=(new_mode)
  handle_old_mode
  @mode = new_mode
  handle_new_mode
end
signal=(new_signal) click to toggle source

Sets the SIGNAL to listen to, Default is SIGPROF

# File lib/ruby-static-tracing/configuration.rb, line 40
def signal=(new_signal)
  disable_trap
  @signal = new_signal
  enable_trap
end