Module: Datadog::Contrib::ActiveSupport::Cache::Patcher

Includes:
Patcher
Defined in:
lib/ddtrace/contrib/active_support/cache/patcher.rb

Overview

Patcher enables patching of ‘active_support’ module.

Class Method Summary collapse

Methods included from Patcher

included

Class Method Details

.cache_store_class(meth) ⇒ Object



25
26
27
# File 'lib/ddtrace/contrib/active_support/cache/patcher.rb', line 25

def cache_store_class(meth)
  ::ActiveSupport::Cache::Store
end

.patchObject



18
19
20
21
22
23
# File 'lib/ddtrace/contrib/active_support/cache/patcher.rb', line 18

def patch
  patch_cache_store_read
  patch_cache_store_fetch
  patch_cache_store_write
  patch_cache_store_delete
end

.patch_cache_store_deleteObject



41
42
43
# File 'lib/ddtrace/contrib/active_support/cache/patcher.rb', line 41

def patch_cache_store_delete
  cache_store_class(:delete).send(:prepend, Cache::Instrumentation::Delete)
end

.patch_cache_store_fetchObject



33
34
35
# File 'lib/ddtrace/contrib/active_support/cache/patcher.rb', line 33

def patch_cache_store_fetch
  cache_store_class(:fetch).send(:prepend, Cache::Instrumentation::Fetch)
end

.patch_cache_store_readObject



29
30
31
# File 'lib/ddtrace/contrib/active_support/cache/patcher.rb', line 29

def patch_cache_store_read
  cache_store_class(:read).send(:prepend, Cache::Instrumentation::Read)
end

.patch_cache_store_writeObject



37
38
39
# File 'lib/ddtrace/contrib/active_support/cache/patcher.rb', line 37

def patch_cache_store_write
  cache_store_class(:write).send(:prepend, Cache::Instrumentation::Write)
end

.target_versionObject



14
15
16
# File 'lib/ddtrace/contrib/active_support/cache/patcher.rb', line 14

def target_version
  Integration.version
end