Class: MemCache

Inherits:
Object
  • Object
show all
Defined in:
lib/time_bandits/monkey_patches/memcache-client.rb

Instance Method Summary collapse

Instance Method Details

#get_multi_with_benchmark(*keys) ⇒ Object Also known as: get_multi



20
21
22
23
24
25
26
# File 'lib/time_bandits/monkey_patches/memcache-client.rb', line 20

def get_multi_with_benchmark(*keys)
  ActiveSupport::Notifications.instrument("get.memcache") do |payload|
    results = get_multi_without_benchmark(*keys)
     payload[:misses] = keys.size - results.size
    results
  end
end

#get_with_benchmark(key, raw = false) ⇒ Object Also known as: get



10
11
12
13
14
15
16
# File 'lib/time_bandits/monkey_patches/memcache-client.rb', line 10

def get_with_benchmark(key, raw = false)
  ActiveSupport::Notifications.instrument("get.memcache") do |payload|
    val = get_without_benchmark(key, raw)
    payload[:misses] = val.nil? ? 1 : 0
    val
  end
end