Module: Datadog::Tracing::Contrib::ActiveSupport::Cache::Instrumentation::FetchMulti

Includes:
InstanceMethods
Defined in:
lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb

Overview

Defines the the legacy monkey-patching instrumentation for ActiveSupport cache fetch_multi DEV-3.0: ActiveSupport::Notifications events were introduced in ActiveSupport 5.2.0 for this method. DEV-3.0: As long as we support ActiveSupport < 5.2.0, we have to keep this method.

Instance Method Summary collapse

Instance Method Details

#fetch_multi(*args, **options, &block) ⇒ Object



170
171
172
173
174
175
# File 'lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb', line 170

def fetch_multi(*args, **options, &block)
  return super if Instrumentation.nested_multiread?

  keys = args[-1].instance_of?(Hash) ? args[0..-2] : args
  Instrumentation.trace(Ext::RESOURCE_CACHE_MGET, dd_store_name, multi_key: keys) { super }
end