Sha256: e8ae068b3b4b1d6abfbaf1304af6beab025e977f0071918583d2e10e13398c3c

Contents?: true

Size: 592 Bytes

Versions: 9

Compression:

Stored size: 592 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

require 'new_relic/agent/event_listener'

module NewRelic::Rack
  class AgentHooks
    def initialize(app, options = {})
      @app = app
    end

    # method required by Rack interface
    # [status, headers, response]
    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
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
newrelic_rpm-3.6.2.96 lib/new_relic/rack/agent_hooks.rb
newrelic_rpm-3.6.2.90.beta lib/new_relic/rack/agent_hooks.rb
newrelic_rpm-3.6.1.88 lib/new_relic/rack/agent_hooks.rb
newrelic_rpm-3.6.1.87 lib/new_relic/rack/agent_hooks.rb
newrelic_rpm-3.6.1.86.beta lib/new_relic/rack/agent_hooks.rb
newrelic_rpm-3.6.1.85.beta lib/new_relic/rack/agent_hooks.rb
newrelic_rpm-3.6.0.83 lib/new_relic/rack/agent_hooks.rb
newrelic_rpm-3.6.0.78 lib/new_relic/rack/agent_hooks.rb
newrelic_rpm-3.6.0.74.beta lib/new_relic/rack/agent_hooks.rb