module Datadog::Contrib::ActiveSupport::Cache::Patcher

Patcher enables patching of 'active_support' module.

Public Instance Methods

cache_store_class(meth) click to toggle source
# File lib/ddtrace/contrib/active_support/cache/patcher.rb, line 29
def cache_store_class(meth)
  ::ActiveSupport::Cache::Store
end
patch() click to toggle source
# File lib/ddtrace/contrib/active_support/cache/patcher.rb, line 19
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
patch_cache_store_delete() click to toggle source
# File lib/ddtrace/contrib/active_support/cache/patcher.rb, line 63
def patch_cache_store_delete
  cache_store_class(:delete).prepend(Cache::Instrumentation::Delete)
end
patch_cache_store_fetch() click to toggle source
# File lib/ddtrace/contrib/active_support/cache/patcher.rb, line 41
def patch_cache_store_fetch
  cache_store_class(:fetch).prepend(Cache::Instrumentation::Fetch)
end
patch_cache_store_fetch_multi() click to toggle source
# File lib/ddtrace/contrib/active_support/cache/patcher.rb, line 45
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
patch_cache_store_read() click to toggle source
# File lib/ddtrace/contrib/active_support/cache/patcher.rb, line 33
def patch_cache_store_read
  cache_store_class(:read).prepend(Cache::Instrumentation::Read)
end
patch_cache_store_read_multi() click to toggle source
# File lib/ddtrace/contrib/active_support/cache/patcher.rb, line 37
def patch_cache_store_read_multi
  cache_store_class(:read_multi).prepend(Cache::Instrumentation::ReadMulti)
end
patch_cache_store_write() click to toggle source
# File lib/ddtrace/contrib/active_support/cache/patcher.rb, line 52
def patch_cache_store_write
  cache_store_class(:write).prepend(Cache::Instrumentation::Write)
end
patch_cache_store_write_multi() click to toggle source
# File lib/ddtrace/contrib/active_support/cache/patcher.rb, line 56
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
target_version() click to toggle source
# File lib/ddtrace/contrib/active_support/cache/patcher.rb, line 15
def target_version
  Integration.version
end