module Oboe::Inst::MemcachedRails
Public Class Methods
included(cls)
click to toggle source
# File lib/oboe/inst/memcached.rb, line 44 def self.included(cls) cls.class_eval do if ::Memcached::Rails.method_defined? :get_multi alias get_multi_without_oboe get_multi alias get_multi get_multi_with_oboe elsif Oboe::Config[:verbose] Oboe.logger.warn '[oboe/loading] Couldn\'t properly instrument Memcached. Partial traces may occur.' end end end
Public Instance Methods
get_multi_with_oboe(keys, raw = false)
click to toggle source
# File lib/oboe/inst/memcached.rb, line 55 def get_multi_with_oboe(keys, raw = false) if Oboe.tracing? layer_kvs = {} layer_kvs[:KVOp] = :get_multi Oboe::API.trace('memcache', layer_kvs || {}, :get_multi) do begin info_kvs = {} info_kvs[:KVKeyCount] = keys.flatten.length values = get_multi_without_oboe(keys, raw) info_kvs[:KVHitCount] = values.length info_kvs[:Backtrace] = Oboe::API.backtrace if Oboe::Config[:memcached][:collect_backtraces] Oboe::API.log('memcache', 'info', info_kvs) rescue values = get_multi_without_oboe(keys, raw) end values end else get_multi_without_oboe(keys, raw) end end