Class: Flipper::Cloud::Telemetry::Instrumenter

Inherits:
Object
  • Object
show all
Defined in:
lib/flipper/cloud/telemetry/instrumenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cloud_configuration, instrumenter) ⇒ Instrumenter

Returns a new instance of Instrumenter.



9
10
11
12
# File 'lib/flipper/cloud/telemetry/instrumenter.rb', line 9

def initialize(cloud_configuration, instrumenter)
  @instrumenter = instrumenter
  @cloud_configuration = cloud_configuration
end

Instance Attribute Details

#instrumenterObject (readonly)

Returns the value of attribute instrumenter.



7
8
9
# File 'lib/flipper/cloud/telemetry/instrumenter.rb', line 7

def instrumenter
  @instrumenter
end

Instance Method Details

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



14
15
16
17
18
# File 'lib/flipper/cloud/telemetry/instrumenter.rb', line 14

def instrument(name, payload = {}, &block)
  return_value = instrumenter.instrument(name, payload, &block)
  @cloud_configuration.telemetry.record(name, payload)
  return_value
end