Module: Sqreen::Ecosystem::DispatchTable

Defined in:
lib/sqreen/ecosystem/dispatch_table.rb

Overview

Configured by the ecosystem client

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.add_request_start_listenerObject

argument: block taking a Rack::Request see Sqreen::EcosystemIntegration::RequestLifecycleTracking#add_start_observer



20
21
22
# File 'lib/sqreen/ecosystem/dispatch_table.rb', line 20

def add_request_start_listener
  @add_request_start_listener
end

.consume_signalObject

data consumption argument: Sqreen::Kit::Signals::Signal see Sqreen::EcosystemIntegration::SignalConsumption#consume_signal



16
17
18
# File 'lib/sqreen/ecosystem/dispatch_table.rb', line 16

def consume_signal
  @consume_signal
end

.fetch_loggerObject

Returns the value of attribute fetch_logger.



22
23
24
# File 'lib/sqreen/ecosystem/dispatch_table.rb', line 22

def fetch_logger
  @fetch_logger
end

.instrumentObject

argument: callback taking:

  • the method to instrument

  • A HashSymbol=>Proc with the advice. The proc takes the

arguments and the ball, so these details of the instrumentation implementation leak through the abstraction see Sqreen::EcosystemIntegration::InstrumentationService



30
31
32
# File 'lib/sqreen/ecosystem/dispatch_table.rb', line 30

def instrument
  @instrument
end

Class Method Details

.resetObject



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/sqreen/ecosystem/dispatch_table.rb', line 32

def reset
  instance_variables.each do |ia|
    instance_variable_set(ia, nil)
  end

  # set default logger
  logger = ::Logger.new(STDERR)
  logger.level = ::Logger::WARN
  logger.progname = 'sqreen-ecosystem'
  self.fetch_logger = proc { logger }
end