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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61b7f1d1191a13333bdd6118ed2884122a21c1ab
4
- data.tar.gz: 017522bfc230e9d4fc8add1633781f14b367f190
3
+ metadata.gz: e558c229aeb86c8b6b480b8b9b1d4fe915e2cdbf
4
+ data.tar.gz: cf6501c46dbf9caeddc1b7254d8f60940112e64d
5
5
  SHA512:
6
- metadata.gz: fb280f341c8339fdf4ecfd0b45a8e2550ebb535662634735122ceb701b146d0d1d0982b162797b175b783ce30ad163495ef8bdf06c380f2ae53572fd9d195465
7
- data.tar.gz: 9891ff14a621a7b5e2da513d0be7595ba364c45d5f922d08b9d312c9fc1dc267907ed785ef4d7e161c8a6df4b247f1a621ee4af6066a53ecb7d7cb93d3b0d4b0
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.1'
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
- res = AmplitudeAPI.track(records.pop(500))
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
- errors << [[res.response_code, res.body]]
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.1
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-06-29 00:00:00.000000000 Z
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd