Module: NewRelic::Security::Instrumentation::Ethon::Easy::Chain

Defined in:
lib/newrelic_security/instrumentation-security/ethon/chain.rb

Class Method Summary collapse

Class Method Details

.instrument!Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/newrelic_security/instrumentation-security/ethon/chain.rb', line 6

def self.instrument!
  ::Ethon::Easy.class_eval do
    include NewRelic::Security::Instrumentation::Ethon::Easy

    alias_method(:headers_equals_without_security, :headers=)
    
    def headers=(headers)
      headers_equals_on_enter(headers) { return headers_equals_without_security(headers) }
    end

    alias_method :perform_without_security, :perform
    
    def perform(*args)
      retval = nil
      event = perform_on_enter(*args) { retval = perform_without_security(*args) }
      perform_on_exit(event) { return retval }
    end
  end
end