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.



27
28
29
30
# File 'lib/kafka/instrumenter.rb', line 27

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

Instance Method Details

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



32
33
34
# File 'lib/kafka/instrumenter.rb', line 32

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