Sha256: 211c19282eaa2f4583e8372edb8337dedb79b00604f5c52de7be69e864df091c
Contents?: true
Size: 1.94 KB
Versions: 3
Compression:
Stored size: 1.94 KB
Contents
require 'ddtrace/contrib/patcher' require 'ddtrace/contrib/active_support/cache/instrumentation' module Datadog module Contrib module ActiveSupport module Cache # Patcher enables patching of 'active_support' module. module Patcher include Contrib::Patcher module_function def target_version 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 end def patch_cache_store_read cache_store_class(:read).prepend(Cache::Instrumentation::Read) end def patch_cache_store_read_multi cache_store_class(:read_multi).prepend(Cache::Instrumentation::ReadMulti) end def patch_cache_store_fetch cache_store_class(:fetch).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.prepend(Cache::Instrumentation::FetchMulti) end def patch_cache_store_write cache_store_class(:write).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.prepend(Cache::Instrumentation::WriteMulti) end def patch_cache_store_delete cache_store_class(:delete).prepend(Cache::Instrumentation::Delete) end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems