lib/ddtrace/contrib/active_support/cache/patcher.rb in ddtrace-0.42.0 vs lib/ddtrace/contrib/active_support/cache/patcher.rb in ddtrace-0.43.0
- old
+ new
@@ -15,12 +15,15 @@
Integration.version
end
def patch
patch_cache_store_read
+ patch_cache_store_read_multi
patch_cache_store_fetch
+ patch_cache_store_fetch_multi
patch_cache_store_write
+ patch_cache_store_write_multi
patch_cache_store_delete
end
def cache_store_class(meth)
::ActiveSupport::Cache::Store
@@ -28,15 +31,33 @@
def patch_cache_store_read
cache_store_class(:read).send(:prepend, Cache::Instrumentation::Read)
end
+ def patch_cache_store_read_multi
+ cache_store_class(:read_multi).send(:prepend, Cache::Instrumentation::ReadMulti)
+ end
+
def patch_cache_store_fetch
cache_store_class(:fetch).send(:prepend, Cache::Instrumentation::Fetch)
end
+ def patch_cache_store_fetch_multi
+ klass = cache_store_class(:fetch_multi)
+ return unless klass.public_method_defined?(:fetch_multi)
+
+ klass.send(:prepend, Cache::Instrumentation::FetchMulti)
+ end
+
def patch_cache_store_write
cache_store_class(:write).send(:prepend, Cache::Instrumentation::Write)
+ end
+
+ def patch_cache_store_write_multi
+ klass = cache_store_class(:write_multi)
+ return unless klass.public_method_defined?(:write_multi)
+
+ klass.send(:prepend, Cache::Instrumentation::WriteMulti)
end
def patch_cache_store_delete
cache_store_class(:delete).send(:prepend, Cache::Instrumentation::Delete)
end