Module: Datadog::Contrib::Dalli::Patcher
- Includes:
- Patcher
- Defined in:
- lib/ddtrace/contrib/dalli/patcher.rb
Overview
Patcher enables patching of ‘dalli’ module.
Defined Under Namespace
Classes: DeprecatedPin
Class Method Summary collapse
-
.add_pin! ⇒ Object
DEPRECATED: Only kept for users still using ‘Dalli.datadog_pin` to configure.
- .get_option(option) ⇒ Object
- .patch ⇒ Object
- .target_version ⇒ Object
Methods included from Patcher
Class Method Details
.add_pin! ⇒ Object
DEPRECATED: Only kept for users still using ‘Dalli.datadog_pin` to configure.
Replaced by configuration API, i.e. `c.use :dalli`.
26 27 28 29 30 31 32 33 34 |
# File 'lib/ddtrace/contrib/dalli/patcher.rb', line 26 def add_pin! DeprecatedPin .new( get_option(:service_name), app: Ext::APP, app_type: Datadog::Ext::AppTypes::CACHE, tracer: -> { get_option(:tracer) } ).onto(::Dalli) end |
.get_option(option) ⇒ Object
36 37 38 |
# File 'lib/ddtrace/contrib/dalli/patcher.rb', line 36 def get_option(option) Datadog.configuration[:dalli].get_option(option) end |
.patch ⇒ Object
19 20 21 22 |
# File 'lib/ddtrace/contrib/dalli/patcher.rb', line 19 def patch add_pin! ::Dalli::Server.send(:include, Instrumentation) end |
.target_version ⇒ Object
15 16 17 |
# File 'lib/ddtrace/contrib/dalli/patcher.rb', line 15 def target_version Integration.version end |