Module: Moped::Instrumentable

Included in:
Node
Defined in:
lib/moped/instrumentable.rb,
lib/moped/instrumentable/log.rb,
lib/moped/instrumentable/noop.rb

Defined Under Namespace

Modules: Log Classes: Noop

Constant Summary collapse

TOPIC =

The name of the topic of operations for Moped.

Since:

  • 2.0.0

"query.moped"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#instrumenterObject

Returns the value of attribute instrumenter.



15
16
17
# File 'lib/moped/instrumentable.rb', line 15

def instrumenter
  @instrumenter
end

Instance Method Details

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

Instrument and execute the provided block.

Examples:

Instrument and execute.

instrument("moped.noop") do
  node.connect
end

Parameters:

  • name (String)

    The name of the operation.

  • payload (Hash) (defaults to: {})

    The payload.

Returns:

  • (Object)

    The result of the yield.

Since:

  • 2.0.0



30
31
32
# File 'lib/moped/instrumentable.rb', line 30

def instrument(name, payload = {}, &block)
  instrumenter.instrument(name, payload, &block)
end