Class: RubyEventStore::InstrumentedRepository
- Inherits:
-
Object
- Object
- RubyEventStore::InstrumentedRepository
- Defined in:
- lib/ruby_event_store/instrumented_repository.rb
Instance Method Summary collapse
- #append_to_stream(events, stream, expected_version) ⇒ Object
- #count(specification) ⇒ Object
- #delete_stream(stream) ⇒ Object
- #has_event?(event_id) ⇒ Boolean
-
#initialize(repository, instrumentation) ⇒ InstrumentedRepository
constructor
A new instance of InstrumentedRepository.
- #last_stream_event(stream) ⇒ Object
- #link_to_stream(event_ids, stream, expected_version) ⇒ Object
- #read(specification) ⇒ Object
- #streams_of(event_id) ⇒ Object
- #update_messages(messages) ⇒ Object
Constructor Details
#initialize(repository, instrumentation) ⇒ InstrumentedRepository
Returns a new instance of InstrumentedRepository.
3 4 5 6 |
# File 'lib/ruby_event_store/instrumented_repository.rb', line 3 def initialize(repository, instrumentation) @repository = repository @instrumentation = instrumentation end |
Instance Method Details
#append_to_stream(events, stream, expected_version) ⇒ Object
8 9 10 11 12 |
# File 'lib/ruby_event_store/instrumented_repository.rb', line 8 def append_to_stream(events, stream, expected_version) instrumentation.instrument("append_to_stream.repository.rails_event_store", events: events, stream: stream) do repository.append_to_stream(events, stream, expected_version) end end |
#count(specification) ⇒ Object
40 41 42 43 44 |
# File 'lib/ruby_event_store/instrumented_repository.rb', line 40 def count(specification) instrumentation.instrument("count.repository.rails_event_store", specification: specification) do repository.count(specification) end end |
#delete_stream(stream) ⇒ Object
20 21 22 23 24 |
# File 'lib/ruby_event_store/instrumented_repository.rb', line 20 def delete_stream(stream) instrumentation.instrument("delete_stream.repository.rails_event_store", stream: stream) do repository.delete_stream(stream) end end |
#has_event?(event_id) ⇒ Boolean
26 27 28 |
# File 'lib/ruby_event_store/instrumented_repository.rb', line 26 def has_event?(event_id) repository.has_event?(event_id) end |
#last_stream_event(stream) ⇒ Object
30 31 32 |
# File 'lib/ruby_event_store/instrumented_repository.rb', line 30 def last_stream_event(stream) repository.last_stream_event(stream) end |
#link_to_stream(event_ids, stream, expected_version) ⇒ Object
14 15 16 17 18 |
# File 'lib/ruby_event_store/instrumented_repository.rb', line 14 def link_to_stream(event_ids, stream, expected_version) instrumentation.instrument("link_to_stream.repository.rails_event_store", event_ids: event_ids, stream: stream) do repository.link_to_stream(event_ids, stream, expected_version) end end |
#read(specification) ⇒ Object
34 35 36 37 38 |
# File 'lib/ruby_event_store/instrumented_repository.rb', line 34 def read(specification) instrumentation.instrument("read.repository.rails_event_store", specification: specification) do repository.read(specification) end end |
#streams_of(event_id) ⇒ Object
52 53 54 55 56 |
# File 'lib/ruby_event_store/instrumented_repository.rb', line 52 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) ⇒ Object
46 47 48 49 50 |
# File 'lib/ruby_event_store/instrumented_repository.rb', line 46 def () instrumentation.instrument("update_messages.repository.rails_event_store", messages: ) do repository.() end end |