class OrientdbClient::Instrumenters::Memory

Instrumentor that is useful for tests as it stores each of the events that are instrumented.

Constants

Event

Attributes

events[R]

Public Class Methods

new() click to toggle source
# File lib/orientdb_client/instrumenters/memory.rb, line 10
def initialize
  @events = []
end

Public Instance Methods

instrument(name, payload = {}) { |payload| ... } click to toggle source
# File lib/orientdb_client/instrumenters/memory.rb, line 14
def instrument(name, payload = {})
  result = nil
  begin
    result = yield payload
  rescue Exception => e
    payload[:exception] = [e.class.name, e.message]
    raise e
  ensure
    @events << Event.new(name, payload, result)
    result
  end
end