Module: Vx::Consumer::Instrument

Included in:
Session, Subscriber
Defined in:
lib/vx/consumer/instrument.rb

Instance Method Summary collapse

Instance Method Details

#instrument(name, payload, &block) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/vx/consumer/instrument.rb', line 5

def instrument(name, payload, &block)
  name = "#{name}.consumer.vx"

  if Consumer.configuration.debug?
    $stdout.puts " --> #{name}: #{payload}"
  end

  if Consumer.configuration.instrumenter
    Consumer.configuration.instrumenter.instrument(name, payload, &block)
  else
    yield if block_given?
  end
end