Class: TimeBandits::TimeConsumers::Memcached::Subscriber

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/time_bandits/time_consumers/memcached.rb

Instance Method Summary collapse

Instance Method Details

#get(event) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/time_bandits/time_consumers/memcached.rb', line 16

def get(event)
  i = Memcached.instance
  i.time += event.duration
  i.calls += 1
  payload = event.payload
  i.reads += payload[:reads]
  i.misses += payload[:misses]
end

#set(event) ⇒ Object



24
25
26
27
28
29
# File 'lib/time_bandits/time_consumers/memcached.rb', line 24

def set(event)
  i = Memcached.instance
  i.time += event.duration
  i.calls += 1
  i.writes += 1
end