class RubyEventStore::InstrumentedRepository

Attributes

instrumentation[R]
repository[R]

Public Class Methods

new(repository, instrumentation) click to toggle source
# File lib/ruby_event_store/instrumented_repository.rb, line 5
def initialize(repository, instrumentation)
  @repository = repository
  @instrumentation = instrumentation
end

Public Instance Methods

append_to_stream(records, stream, expected_version) click to toggle source
# File lib/ruby_event_store/instrumented_repository.rb, line 10
def append_to_stream(records, stream, expected_version)
  instrumentation.instrument("append_to_stream.repository.rails_event_store", events: records, stream: stream) do
    repository.append_to_stream(records, stream, expected_version)
  end
end
count(specification) click to toggle source
# File lib/ruby_event_store/instrumented_repository.rb, line 34
def count(specification)
  instrumentation.instrument("count.repository.rails_event_store", specification: specification) do
    repository.count(specification)
  end
end
delete_stream(stream) click to toggle source
# File lib/ruby_event_store/instrumented_repository.rb, line 22
def delete_stream(stream)
  instrumentation.instrument("delete_stream.repository.rails_event_store", stream: stream) do
    repository.delete_stream(stream)
  end
end
method_missing(method_name, *arguments, **keyword_arguments, &block) click to toggle source
Calls superclass method
# File lib/ruby_event_store/instrumented_repository.rb, line 52
def method_missing(method_name, *arguments, **keyword_arguments, &block)
  if respond_to?(method_name)
    repository.public_send(method_name, *arguments, **keyword_arguments, &block)
  else
    super
  end
end
read(specification) click to toggle source
# File lib/ruby_event_store/instrumented_repository.rb, line 28
def read(specification)
  instrumentation.instrument("read.repository.rails_event_store", specification: specification) do
    repository.read(specification)
  end
end
respond_to_missing?(method_name, _include_private) click to toggle source
# File lib/ruby_event_store/instrumented_repository.rb, line 60
def respond_to_missing?(method_name, _include_private)
  repository.respond_to?(method_name)
end
streams_of(event_id) click to toggle source
# File lib/ruby_event_store/instrumented_repository.rb, line 46
def streams_of(event_id)
  instrumentation.instrument("streams_of.repository.rails_event_store", event_id: event_id) do
    repository.streams_of(event_id)
  end
end
update_messages(messages) click to toggle source
# File lib/ruby_event_store/instrumented_repository.rb, line 40
def update_messages(messages)
  instrumentation.instrument("update_messages.repository.rails_event_store", messages: messages) do
    repository.update_messages(messages)
  end
end