wavefront-sdk 3.7.0 → 3.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +4 -0
- data/lib/wavefront-sdk/defs/version.rb +1 -1
- data/lib/wavefront-sdk/write.rb +13 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8a2c03d2fff24c9d9c986c89203a60dd5535d93c5df5018fc7fdb9fcd4a50a8
|
4
|
+
data.tar.gz: 2957c881c681837d8e90f0c83b635a62e59d5806091f74f9861a4561f8422a83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80ffca53940c2d25cdaf6c5248fa0a5eddcbeeed7fc390d1f79405a2bf55fc9b1981624082891aa994e5e243238a37046ddb470829c5eb1140f37fef4dc6a520
|
7
|
+
data.tar.gz: 4b68cae0043168eba7232296c15916a5d7e872cec758a217e8824e78a6a4945569d7d8d8e030a999b2cfb83aab2636617eb94fda12352c6985ce532a7206b416
|
data/HISTORY.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.7.1 (2020-02-09)
|
4
|
+
* `Response` object returned by `Wavefront::Write#write` includes a valid HTTP
|
5
|
+
code, rather than `nil`.
|
6
|
+
|
3
7
|
## 3.7.0 (2020-01-23)
|
4
8
|
* Add `Account`, `Usage` and `IngestionPolicy` classes.
|
5
9
|
* Allow modification of `Wavefront::Response`'s `response` object.
|
data/lib/wavefront-sdk/write.rb
CHANGED
@@ -107,12 +107,14 @@ module Wavefront
|
|
107
107
|
end
|
108
108
|
|
109
109
|
# Compound the responses of all chunked writes into one. It will
|
110
|
-
# be 'ok' only if *everything* passed.
|
110
|
+
# be 'ok' only if *everything* passed. Returns 400 as the HTTP code on
|
111
|
+
# error, regardless of what actual errors occurred.
|
111
112
|
# @param responses [Array[Wavefront::Response]]
|
112
113
|
# @return Wavefront::Response
|
113
114
|
#
|
114
115
|
def composite_response(responses)
|
115
|
-
result = responses
|
116
|
+
result, code = response_codes(responses)
|
117
|
+
|
116
118
|
summary = { sent: 0, rejected: 0, unsent: 0 }
|
117
119
|
|
118
120
|
%i[sent rejected unsent].each do |k|
|
@@ -120,7 +122,7 @@ module Wavefront
|
|
120
122
|
end
|
121
123
|
|
122
124
|
Wavefront::Response.new(
|
123
|
-
{ status: { result: result, message: nil, code:
|
125
|
+
{ status: { result: result, message: nil, code: code },
|
124
126
|
response: summary.to_h }.to_json, nil
|
125
127
|
)
|
126
128
|
end
|
@@ -246,5 +248,13 @@ module Wavefront
|
|
246
248
|
rescue LoadError
|
247
249
|
raise(Wavefront::Exception::UnsupportedWriter, writer)
|
248
250
|
end
|
251
|
+
|
252
|
+
def response_codes(responses)
|
253
|
+
if responses.all?(&:ok?)
|
254
|
+
['OK', 200]
|
255
|
+
else
|
256
|
+
['ERROR', 400]
|
257
|
+
end
|
258
|
+
end
|
249
259
|
end
|
250
260
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wavefront-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.7.
|
4
|
+
version: 3.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Fisher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|