Class: Stripe::Instrumentation::RequestEndEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/stripe/instrumentation.rb

Overview

Event emitted on ‘request_end` callback.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_context:, response_context:, num_retries:, user_data: nil) ⇒ RequestEndEvent

Returns a new instance of RequestEndEvent.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/stripe/instrumentation.rb', line 38

def initialize(request_context:, response_context:,
               num_retries:, user_data: nil)
  @duration = request_context.duration
  @http_status = response_context.http_status
  @method = request_context.method
  @num_retries = num_retries
  @path = request_context.path
  @request_id = request_context.request_id
  @user_data = user_data
  @response_header = response_context.header
  @response_body = response_context.body
  @request_header = request_context.header
  @request_body = request_context.body
  freeze
end

Instance Attribute Details

#durationObject (readonly)

Returns the value of attribute duration.



29
30
31
# File 'lib/stripe/instrumentation.rb', line 29

def duration
  @duration
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



29
30
31
# File 'lib/stripe/instrumentation.rb', line 29

def http_status
  @http_status
end

#methodObject (readonly)

Returns the value of attribute method.



29
30
31
# File 'lib/stripe/instrumentation.rb', line 29

def method
  @method
end

#num_retriesObject (readonly)

Returns the value of attribute num_retries.



29
30
31
# File 'lib/stripe/instrumentation.rb', line 29

def num_retries
  @num_retries
end

#pathObject (readonly)

Returns the value of attribute path.



29
30
31
# File 'lib/stripe/instrumentation.rb', line 29

def path
  @path
end

#request_bodyObject (readonly)

Returns the value of attribute request_body.



29
30
31
# File 'lib/stripe/instrumentation.rb', line 29

def request_body
  @request_body
end

#request_headerObject (readonly)

Returns the value of attribute request_header.



29
30
31
# File 'lib/stripe/instrumentation.rb', line 29

def request_header
  @request_header
end

#request_idObject (readonly)

Returns the value of attribute request_id.



29
30
31
# File 'lib/stripe/instrumentation.rb', line 29

def request_id
  @request_id
end

#response_bodyObject (readonly)

Returns the value of attribute response_body.



29
30
31
# File 'lib/stripe/instrumentation.rb', line 29

def response_body
  @response_body
end

#response_headerObject (readonly)

Returns the value of attribute response_header.



29
30
31
# File 'lib/stripe/instrumentation.rb', line 29

def response_header
  @response_header
end

#user_dataObject (readonly)

Arbitrary user-provided data in the form of a Ruby hash that’s passed from subscribers on ‘request_begin` to subscribers on `request_end`. `request_begin` subscribers can set keys which will then be available in `request_end`.



36
37
38
# File 'lib/stripe/instrumentation.rb', line 36

def user_data
  @user_data
end