fluent-plugin-amplitude 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-amplitude.gemspec +1 -1
- data/lib/fluent/plugin/out_amplitude.rb +7 -4
- 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: e558c229aeb86c8b6b480b8b9b1d4fe915e2cdbf
|
4
|
+
data.tar.gz: cf6501c46dbf9caeddc1b7254d8f60940112e64d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b679e57c4c8be50962adf2d1b1bfc0adaf5345bf5f728b72382817ea25e2a6f5077ccba8fbf9bb13897afd019f8c5eb6c11f67ee39ad359950eb2a359243fc6
|
7
|
+
data.tar.gz: afa3874c4568918097ac9c5b369ecf5a43c7a07470c4053947d0c7be0a698e1390c9533521d89809b45009feaac46b52d849cf6d36dbb525e3a580a2629932f1
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'fluent-plugin-amplitude'
|
7
|
-
spec.version = '0.2.
|
7
|
+
spec.version = '0.2.2'
|
8
8
|
spec.authors = ['Change.org']
|
9
9
|
spec.email = ['tech_ops@change.org']
|
10
10
|
spec.summary = 'Fluentd plugin to output event data to Amplitude'
|
@@ -164,9 +164,12 @@ module Fluent
|
|
164
164
|
log.info("sending #{records.length} to amplitude")
|
165
165
|
errors = []
|
166
166
|
until records.empty?
|
167
|
-
|
167
|
+
records_to_send = records.pop(500)
|
168
|
+
start_time = Time.now.to_i
|
169
|
+
res = AmplitudeAPI.track(records_to_send)
|
168
170
|
unless res.response_code == 200
|
169
|
-
|
171
|
+
fail_time = Time.now.to_i
|
172
|
+
errors << [res.response_code, res.body, records_to_send, fail_time - start_time]
|
170
173
|
end
|
171
174
|
end
|
172
175
|
log_errors(errors)
|
@@ -174,8 +177,8 @@ module Fluent
|
|
174
177
|
|
175
178
|
def log_errors(errors)
|
176
179
|
return if errors.empty?
|
177
|
-
errors_string = errors.map do |code, body|
|
178
|
-
"Response: #{code} Body: #{body}"
|
180
|
+
errors_string = errors.map do |code, body, records, time|
|
181
|
+
"Response: #{code}, Time: #{time}, Body: #{body}, Record: #{records}"
|
179
182
|
end
|
180
183
|
raise AmplitudeError, "Errors: #{errors_string}"
|
181
184
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-amplitude
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Change.org
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|