class Memcached
Public Instance Methods
get_with_benchmark(key, marshal = true)
click to toggle source
# File lib/time_bandits/monkey_patches/memcached.rb, line 9 def get_with_benchmark(key, marshal = true) ActiveSupport::Notifications.instrument("get.memcached") do |payload| if key.is_a?(Array) payload[:reads] = (num_keys = key.size) results = [] begin results = get_without_benchmark(key, marshal) rescue Memcached::NotFound end payload[:misses] = num_keys - results.size results else val = nil payload[:reads] = 1 begin val = get_without_benchmark(key, marshal) rescue Memcached::NotFound end payload[:misses] = val.nil? ? 1 : 0 val end end end
Also aliased as: get
set_with_benchmark(*args)
click to toggle source
# File lib/time_bandits/monkey_patches/memcached.rb, line 35 def set_with_benchmark(*args) ActiveSupport::Notifications.instrument("set.memcached") do set_without_benchmark(*args) end end
Also aliased as: set