Class: Stripe::APIRequestor::StripeRequestMetrics
- Inherits:
-
Object
- Object
- Stripe::APIRequestor::StripeRequestMetrics
- Defined in:
- lib/stripe/api_requestor.rb
Overview
StripeRequestMetrics tracks metadata to be reported to stripe for metrics collection
Instance Attribute Summary collapse
-
#request_duration_ms ⇒ Object
Request duration in milliseconds.
-
#request_id ⇒ Object
The Stripe request ID of the response.
-
#usage ⇒ Object
list of names of tracked behaviors associated with this request.
Instance Method Summary collapse
-
#initialize(request_id, request_duration_ms, usage: []) ⇒ StripeRequestMetrics
constructor
A new instance of StripeRequestMetrics.
- #payload ⇒ Object
Constructor Details
#initialize(request_id, request_duration_ms, usage: []) ⇒ StripeRequestMetrics
Returns a new instance of StripeRequestMetrics.
1118 1119 1120 1121 1122 |
# File 'lib/stripe/api_requestor.rb', line 1118 def initialize(request_id, request_duration_ms, usage: []) self.request_id = request_id self.request_duration_ms = request_duration_ms self.usage = usage end |
Instance Attribute Details
#request_duration_ms ⇒ Object
Request duration in milliseconds
1113 1114 1115 |
# File 'lib/stripe/api_requestor.rb', line 1113 def request_duration_ms @request_duration_ms end |
#request_id ⇒ Object
The Stripe request ID of the response.
1110 1111 1112 |
# File 'lib/stripe/api_requestor.rb', line 1110 def request_id @request_id end |
#usage ⇒ Object
list of names of tracked behaviors associated with this request
1116 1117 1118 |
# File 'lib/stripe/api_requestor.rb', line 1116 def usage @usage end |
Instance Method Details
#payload ⇒ Object
1124 1125 1126 1127 1128 |
# File 'lib/stripe/api_requestor.rb', line 1124 def payload ret = { request_id: request_id, request_duration_ms: request_duration_ms } ret[:usage] = usage if !usage.nil? && !usage.empty? ret end |