lib/oboe/inst/dalli.rb in oboe-2.2.6 vs lib/oboe/inst/dalli.rb in oboe-2.3.2
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (c) 2012 by Tracelytics, Inc.
+# Copyright (c) 2013 AppNeta, Inc.
# All rights reserved.
module Oboe
module Inst
module Dalli
@@ -30,13 +30,16 @@
opts[:KVOp] = op
opts[:KVKey] = key
Oboe::API.trace('memcache', opts || {}) do
result = perform_without_oboe(*all_args, &blk)
- if op == :get and key.class == String
- Oboe::API.log('memcache', 'info', { :KVHit => memcache_hit?(result) })
- end
+
+ info_kvs = {}
+ info_kvs[:KVHit] = memcache_hit?(result) if op == :get and key.class == String
+ info_kvs[:Backtrace] = Oboe::API.backtrace if Oboe::Config[:dalli][:collect_backtraces]
+
+ Oboe::API.log('memcache', 'info', info_kvs) unless info_kvs.empty?
result
end
else
perform_without_oboe(*all_args, &blk)
end
@@ -58,9 +61,10 @@
end
values = get_multi_without_oboe(keys)
info_kvs[:KVHitCount] = values.length
+ info_kvs[:Backtrace] = Oboe::API.backtrace if Oboe::Config[:dalli][:collect_backtraces]
Oboe::API.log('memcache', 'info', info_kvs)
rescue
values = get_multi_without_oboe(keys)
end
values