Class: Kafka::DecoratingInstrumenter

Inherits:
Object
  • Object
show all
Defined in:
lib/kafka/instrumenter.rb

Instance Method Summary collapse

Constructor Details

#initialize(backend, extra_payload = {}) ⇒ DecoratingInstrumenter

Returns a new instance of DecoratingInstrumenter.



29
30
31
32
# File 'lib/kafka/instrumenter.rb', line 29

def initialize(backend, extra_payload = {})
  @backend = backend
  @extra_payload = extra_payload
end

Instance Method Details

#instrument(event_name, payload = {}, &block) ⇒ Object



34
35
36
# File 'lib/kafka/instrumenter.rb', line 34

def instrument(event_name, payload = {}, &block)
  @backend.instrument(event_name, @extra_payload.merge(payload), &block)
end