Sha256: 377a31dc3eceef8836a24e8783872748ef8d8930b5d230c123e4fe35ab989244

Contents?: true

Size: 668 Bytes

Versions: 14

Compression:

Stored size: 668 Bytes

Contents

module Net::LDAP::Instrumentation
  attr_reader :instrumentation_service
  private     :instrumentation_service

  # Internal: Instrument a block with the defined instrumentation service.
  #
  # Yields the event payload if a block is given.
  #
  # Skips instrumentation if no service is set.
  #
  # Returns the return value of the block.
  def instrument(event, payload = {})
    payload = (payload || {}).dup
    if instrumentation_service
      instrumentation_service.instrument(event, payload) do |payload|
        payload[:result] = yield(payload) if block_given?
      end
    else
      yield(payload) if block_given?
    end
  end
  private :instrument
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
net-ldap-0.16.2 lib/net/ldap/instrumentation.rb
net-ldap-0.16.1 lib/net/ldap/instrumentation.rb
net-ldap-0.16.0 lib/net/ldap/instrumentation.rb
net-ldap-0.15.0 lib/net/ldap/instrumentation.rb
net-ldap-0.14.0 lib/net/ldap/instrumentation.rb
net-ldap-0.13.0 lib/net/ldap/instrumentation.rb
net-ldap-0.12.1 lib/net/ldap/instrumentation.rb
net-ldap-0.12.0 lib/net/ldap/instrumentation.rb
rubinius-net-ldap-0.11 lib/net/ldap/instrumentation.rb
net-ldap-0.11 lib/net/ldap/instrumentation.rb
net-ldap-0.10.1 lib/net/ldap/instrumentation.rb
net-ldap-0.10.0 lib/net/ldap/instrumentation.rb
net-ldap-0.9.0 lib/net/ldap/instrumentation.rb
net-ldap-0.8.0 lib/net/ldap/instrumentation.rb