stripe 3.31.0 → 3.31.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/stripe/stripe_client.rb +8 -7
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/stripe_client_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25ebfbf84bcee0acb6cab757e949ab8654b7e41d
|
4
|
+
data.tar.gz: '09546cf8adf0ad0dbfabd54675e256edfabdfab5'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c10a085b2465b5da8ba4490d6c34cd25be875fa5bdb0de22e4e02c25b457d7d57bf8476c8126c0a2f1c7df9d4f0b4a401f0341b0bc2b230cd3cc535b40e40f9d
|
7
|
+
data.tar.gz: 6779c4a2e3561ec53bc52a929cb51c17d9b17b2eea2ffb35f511924a84a8690be9f32022055de581d165a34d45adb2e74598583ae532cd13a5e47db3277e0ef4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.31.1 - 2018-11-12
|
4
|
+
* [#697](https://github.com/stripe/stripe-ruby/pull/697) Send telemetry in milliseconds specifically
|
5
|
+
|
3
6
|
## 3.31.0 - 2018-11-12
|
4
7
|
* [#696](https://github.com/stripe/stripe-ruby/pull/696) Add configurable telemetry to gather information on client-side request latency
|
5
8
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.31.
|
1
|
+
3.31.1
|
data/lib/stripe/stripe_client.rb
CHANGED
@@ -219,7 +219,8 @@ module Stripe
|
|
219
219
|
context = context.dup_from_response(resp)
|
220
220
|
log_response(context, request_start, resp.status, resp.body)
|
221
221
|
if Stripe.enable_telemetry?
|
222
|
-
|
222
|
+
request_duration_ms = ((Time.now - request_start) * 1000).to_int
|
223
|
+
@last_request_metrics = StripeRequestMetrics.new(context.request_id, request_duration_ms)
|
223
224
|
end
|
224
225
|
|
225
226
|
# We rescue all exceptions from a request so that we have an easy spot to
|
@@ -607,16 +608,16 @@ module Stripe
|
|
607
608
|
# The Stripe request ID of the response.
|
608
609
|
attr_accessor :request_id
|
609
610
|
|
610
|
-
# Request duration
|
611
|
-
attr_accessor :
|
611
|
+
# Request duration in milliseconds
|
612
|
+
attr_accessor :request_duration_ms
|
612
613
|
|
613
|
-
def initialize(request_id,
|
614
|
-
self.request_id
|
615
|
-
self.
|
614
|
+
def initialize(request_id, request_duration_ms)
|
615
|
+
self.request_id = request_id
|
616
|
+
self.request_duration_ms = request_duration_ms
|
616
617
|
end
|
617
618
|
|
618
619
|
def payload
|
619
|
-
{ request_id: request_id,
|
620
|
+
{ request_id: request_id, request_duration_ms: request_duration_ms }
|
620
621
|
end
|
621
622
|
end
|
622
623
|
end
|
data/lib/stripe/version.rb
CHANGED
@@ -791,7 +791,7 @@ module Stripe
|
|
791
791
|
|
792
792
|
trace_payload = JSON.parse(trace_metrics_header)
|
793
793
|
assert(trace_payload["last_request_metrics"]["request_id"] == "req_123")
|
794
|
-
assert(!trace_payload["last_request_metrics"]["
|
794
|
+
assert(!trace_payload["last_request_metrics"]["request_duration_ms"].nil?)
|
795
795
|
end
|
796
796
|
end
|
797
797
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.31.
|
4
|
+
version: 3.31.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|