Class: NewRelic::Rack::AgentHooks

Inherits:
Object
  • Object
show all
Defined in:
lib/new_relic/rack/agent_hooks.rb

Instance Method Summary collapse

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, options = {})
  @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