Class: Faraday::Request::Instrumentation
- Inherits:
-
Middleware
- Object
- Middleware
- Faraday::Request::Instrumentation
- Defined in:
- lib/faraday/request/instrumentation.rb
Overview
Middleware for instrumenting Requests.
Defined Under Namespace
Classes: Options
Instance Attribute Summary
Attributes inherited from Middleware
Attributes included from DependencyLoader
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = nil) ⇒ Instrumentation
constructor
Instruments requests using Active Support.
Methods inherited from Middleware
Methods included from MiddlewareRegistry
#fetch_middleware, #load_middleware, #lookup_middleware, #middleware_mutex, #register_middleware, #unregister_middleware
Methods included from DependencyLoader
#dependency, #inherited, #loaded?, #new
Constructor Details
#initialize(app, options = nil) ⇒ Instrumentation
Instruments requests using Active Support.
Measures time spent only for synchronous requests.
40 41 42 43 44 |
# File 'lib/faraday/request/instrumentation.rb', line 40 def initialize(app, = nil) super(app) @name, @instrumenter = Options.from() .values_at(:name, :instrumenter) end |
Instance Method Details
#call(env) ⇒ Object
47 48 49 50 51 |
# File 'lib/faraday/request/instrumentation.rb', line 47 def call(env) @instrumenter.instrument(@name, env) do @app.call(env) end end |