Class: TimeBandits::TimeConsumers::Dalli::Subscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- TimeBandits::TimeConsumers::Dalli::Subscriber
- Defined in:
- lib/time_bandits/time_consumers/dalli.rb
Instance Method Summary collapse
- #cache_decrement(event) ⇒ Object
- #cache_delete(event) ⇒ Object
- #cache_increment(event) ⇒ Object
-
#cache_read(event) ⇒ Object
cache events are: read write fetch_hit generate delete read_multi increment decrement clear.
- #cache_read_multi(event) ⇒ Object
- #cache_write(event) ⇒ Object
Instance Method Details
#cache_decrement(event) ⇒ Object
30 31 32 33 |
# File 'lib/time_bandits/time_consumers/dalli.rb', line 30 def cache_decrement(event) i = cache(event) i.writes += 1 end |
#cache_delete(event) ⇒ Object
35 36 37 38 |
# File 'lib/time_bandits/time_consumers/dalli.rb', line 35 def cache_delete(event) i = cache(event) i.writes += 1 end |
#cache_increment(event) ⇒ Object
25 26 27 28 |
# File 'lib/time_bandits/time_consumers/dalli.rb', line 25 def cache_increment(event) i = cache(event) i.writes += 1 end |
#cache_read(event) ⇒ Object
cache events are: read write fetch_hit generate delete read_multi increment decrement clear
9 10 11 12 13 |
# File 'lib/time_bandits/time_consumers/dalli.rb', line 9 def cache_read(event) i = cache(event) i.reads += 1 i.misses += 1 unless event.payload[:hit] end |
#cache_read_multi(event) ⇒ Object
15 16 17 18 |
# File 'lib/time_bandits/time_consumers/dalli.rb', line 15 def cache_read_multi(event) i = cache(event) i.reads += event.payload[:key].size end |
#cache_write(event) ⇒ Object
20 21 22 23 |
# File 'lib/time_bandits/time_consumers/dalli.rb', line 20 def cache_write(event) i = cache(event) i.writes += 1 end |