class Faraday::Request::Instrumentation
Middleware for instrumenting Requests.
def call(env)
-
env
(Faraday::Env
) --
def call(env) @instrumenter.instrument(@name, env) do @app.call(env) end end
def initialize(app, options = nil)
(**options)
-
:instrumenter
(Class
) -- -
:name
(String
) --
Parameters:
-
options
(nil, Hash
) -- Options hash -
app
(#call
) --
Other tags:
- Example: Using ActiveSupport::Notifications to measure time spent -
def initialize(app, options = nil) super(app) @name, @instrumenter = Options.from(options) .values_at(:name, :instrumenter) end