Class: NewRelic::Rack::AgentHooks
- Inherits:
-
Object
- Object
- NewRelic::Rack::AgentHooks
- Defined in:
- lib/new_relic/rack/agent_hooks.rb
Instance Method Summary collapse
-
#call(env) ⇒ Object
method required by Rack interface [status, headers, response].
-
#initialize(app, options = {}) ⇒ AgentHooks
constructor
A new instance of AgentHooks.
Constructor Details
#initialize(app, options = {}) ⇒ AgentHooks
Returns a new instance of AgentHooks.
5 6 7 |
# File 'lib/new_relic/rack/agent_hooks.rb', line 5 def initialize(app, = {}) @app = app end |
Instance Method Details
#call(env) ⇒ Object
method required by Rack interface
- status, headers, response
11 12 13 14 15 16 17 |
# File 'lib/new_relic/rack/agent_hooks.rb', line 11 def call(env) events = NewRelic::Agent.instance.events events.notify(:before_call, env) result = @app.call(env) events.notify(:after_call, env, result) result end |