appsignal 0.11.0.beta.2 → 0.11.0

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: 63d0b9ad8e612b7cada5847340bb81082f031832
4
- data.tar.gz: 78e3cdba200a431b45022b8c66e199a7333ff9f4
3
+ metadata.gz: e9fd11fafb3322ce74b514c93301324d737e4946
4
+ data.tar.gz: 9075e749b6dd0f34b966057fd5e0535b5cde5e21
5
5
  SHA512:
6
- metadata.gz: c58a90d4aa99cd4037c42a572f1db0feeccd1faddef9cfc521ab7d5c401fcc5694cd4cf20a1e59bda2dcda8f030eac0b55d8d0a7827ec1cf68d0e7a6790c5724
7
- data.tar.gz: 4ad72753a5ae524a1b8698e7fed5a5b5f353c16c98ccc0c4a384140dee6524a89ef1895e4cbb636468277a397a93345291f6a1c0ede8d8d39eba7575b948a23b
6
+ metadata.gz: 0fdbf566062f6f4aaad9c37f640ac0d39d0600807dccc1344b89f7518d9dcf325b921a11c362c6e279f0d3e401859932064827e1195fd0f06529f9c3d776afd7
7
+ data.tar.gz: c01cdf83266ffea67aa0131a5909485b96638948dea3e415fb30f7303182c98fe3e1f35a7ee89839924f7b0c17f55cf409ede336cb51e05c4c12342e76cd2dca
@@ -3,6 +3,7 @@
3
3
  * Retry sending data when the push api is not reachable
4
4
  * Our own event handling to allow for more flexibility and reliability
5
5
  when using a threaded environment
6
+ * Resque officially supported!
6
7
 
7
8
  # 0.10.6
8
9
  * Add config option to skip session data
@@ -35,14 +35,15 @@ module Appsignal
35
35
  begin
36
36
  sleep(rand(sleep_time))
37
37
  loop do
38
- send_queue if aggregator.has_transactions?
38
+ if aggregator.has_transactions? || aggregator_queue.any?
39
+ send_queue
40
+ end
39
41
  truncate_aggregator_queue
40
42
  Appsignal.logger.debug("Sleeping #{sleep_time}")
41
43
  sleep(sleep_time)
42
44
  end
43
45
  rescue Exception=>ex
44
- Appsignal.logger.error "#{ex.class} in agent thread: '#{ex.message}'"
45
- Appsignal.logger.error ex.backtrace.join('\n')
46
+ Appsignal.logger.error "#{ex.class} in agent thread: '#{ex.message}'\n#{ex.backtrace.join("\n")}"
46
47
  end
47
48
  end
48
49
  end
@@ -111,8 +112,7 @@ module Appsignal
111
112
  add_to_aggregator_queue(aggregator_to_be_sent.post_processed_queue!)
112
113
  send_aggregators
113
114
  rescue Exception => ex
114
- Appsignal.logger.error "#{ex.class} while sending queue: #{ex.message}"
115
- Appsignal.logger.error ex.backtrace.join('\n')
115
+ Appsignal.logger.error "#{ex.class} while sending queue: #{ex.message}\n#{ex.backtrace.join("\n")}"
116
116
  end
117
117
  end
118
118
 
@@ -128,7 +128,8 @@ module Appsignal
128
128
  else
129
129
  payload
130
130
  end
131
- rescue *Transmitter::HTTP_ERRORS
131
+ rescue *Transmitter::HTTP_ERRORS => ex
132
+ Appsignal.logger.error "#{ex} while sending aggregators"
132
133
  payload
133
134
  end
134
135
  end.compact!
@@ -12,6 +12,7 @@ module Appsignal
12
12
 
13
13
  HTTP_ERRORS = [
14
14
  EOFError,
15
+ Errno::ECONNREFUSED,
15
16
  Errno::ECONNRESET,
16
17
  Errno::EINVAL,
17
18
  Net::HTTPBadResponse,
@@ -1,3 +1,3 @@
1
1
  module Appsignal
2
- VERSION = '0.11.0.beta.2'
2
+ VERSION = '0.11.0'
3
3
  end
@@ -67,6 +67,19 @@ describe Appsignal::Agent do
67
67
  end
68
68
  end
69
69
 
70
+ context "with items in the aggregator queue" do
71
+ before do
72
+ subject.aggregator_queue.stub(:any? => true)
73
+ end
74
+
75
+ it "should send the queue and sleep" do
76
+ subject.should_receive(:send_queue).at_least(:twice)
77
+
78
+ subject.start_thread
79
+ sleep 2
80
+ end
81
+ end
82
+
70
83
  context "when an exception occurs in the thread" do
71
84
  before do
72
85
  aggregator = double
@@ -78,7 +91,7 @@ describe Appsignal::Agent do
78
91
 
79
92
  it "should log the error" do
80
93
  Appsignal.logger.should_receive(:error).
81
- with("RuntimeError in agent thread: 'error'").
94
+ with(kind_of(String)).
82
95
  once
83
96
 
84
97
  subject.start_thread
@@ -267,9 +280,6 @@ describe Appsignal::Agent do
267
280
  PostProcessingException.new('Message')
268
281
  )
269
282
 
270
- Appsignal.logger.should_receive(:error).
271
- with('PostProcessingException while sending queue: Message').
272
- once
273
283
  Appsignal.logger.should_receive(:error).
274
284
  with(kind_of(String)).
275
285
  once
@@ -280,9 +290,6 @@ describe Appsignal::Agent do
280
290
  Exception.new('Message')
281
291
  )
282
292
 
283
- Appsignal.logger.should_receive(:error).
284
- with('Exception while sending queue: Message').
285
- once
286
293
  Appsignal.logger.should_receive(:error).
287
294
  with(kind_of(String)).
288
295
  once
@@ -331,10 +338,14 @@ describe Appsignal::Agent do
331
338
  end
332
339
  end
333
340
 
334
- context "when an exception occurred during sending" do
341
+ context "when an exception related to connection problems occurred during sending" do
335
342
  before { subject.stub(:transmitter).and_raise(OpenSSL::SSL::SSLError.new) }
336
343
 
337
344
  it "should remove only successfully sent item from the queue" do
345
+ Appsignal.logger.should_receive(:error).
346
+ with(kind_of(String)).
347
+ once
348
+
338
349
  expect {
339
350
  subject.send_aggregators
340
351
  }.to_not change(subject, :aggregator_queue)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0.beta.2
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-10-24 00:00:00.000000000 Z
15
+ date: 2014-11-17 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rack
@@ -242,9 +242,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
242
242
  version: 1.9.3
243
243
  required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  requirements:
245
- - - ">"
245
+ - - ">="
246
246
  - !ruby/object:Gem::Version
247
- version: 1.3.1
247
+ version: '0'
248
248
  requirements: []
249
249
  rubyforge_project:
250
250
  rubygems_version: 2.2.2