appsignal 0.9.0.beta.1 → 0.9.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: bdc4cda7db92e57aa1ffaf77314c40c1a2423f75
4
- data.tar.gz: 12488e63f0ed2ffd7885c7ec133d541d50384e9a
3
+ metadata.gz: 226f414f32b34a19319e026fd18d46eba9e099c3
4
+ data.tar.gz: 5bf409703a3c98fc0c69813e7113b58eff4e3d08
5
5
  SHA512:
6
- metadata.gz: a0c304d2473fc8682e5c3d01a206d31c3dd8099becbae96710243ae21c4e481c3783c1bd65ac7f52c290c84da0fa33dde2735799df65425c768ef0dd8ddf5ebc
7
- data.tar.gz: cda2ec4044e836319a8269c3ff2eeeaad1c4615efe5a9b61fd6fa47be9f2fb71f16b3cafad8c0ae63d07ad7d170939756ef8062163604f92d7849bee866ca4a4
6
+ metadata.gz: eaeae87208d56bf8572de0b6644a52d39f5a01b1d152ff3d67022edb1ad4b6d922adc9265f4a46bf3d357b93bc1411fba26e662ba43fc8e67c5b15d15bdadb76
7
+ data.tar.gz: 1cea5690d17117fd5f7c35ce3c4883164ea4cb8958a37bd199a8c93c58bb788d26b193daf5562cf3c5d7499331f4d716b1ac2d6fc39a7a53254314d7604acba2
@@ -5,6 +5,9 @@
5
5
  * Net::HTTP instrumentation
6
6
  * Capistrano 3 support
7
7
 
8
+ # 0.8.15
9
+ * Exception logging in agent thread
10
+
8
11
  # 0.8.14
9
12
  * Few tweaks in logging
10
13
  * Clarify Appsignal::Transaction.complete! code
@@ -24,11 +24,16 @@ module Appsignal
24
24
  def start_thread
25
25
  Appsignal.logger.debug('Starting agent thread')
26
26
  @thread = Thread.new do
27
- sleep(rand(sleep_time))
28
- loop do
29
- send_queue if aggregator.has_transactions?
30
- Appsignal.logger.debug("Sleeping #{sleep_time}")
31
- sleep(sleep_time)
27
+ begin
28
+ sleep(rand(sleep_time))
29
+ loop do
30
+ send_queue if aggregator.has_transactions?
31
+ Appsignal.logger.debug("Sleeping #{sleep_time}")
32
+ sleep(sleep_time)
33
+ end
34
+ rescue Exception=>ex
35
+ Appsignal.logger.error "#{ex.class} in agent thread: '#{ex.message}'"
36
+ Appsignal.logger.error ex.backtrace.join('\n')
32
37
  end
33
38
  end
34
39
  end
@@ -1,3 +1,3 @@
1
1
  module Appsignal
2
- VERSION = '0.9.0.beta.1'
2
+ VERSION = '0.9.0'
3
3
  end
@@ -58,6 +58,28 @@ describe Appsignal::Agent do
58
58
  sleep 1
59
59
  end
60
60
  end
61
+
62
+ context "when an exception occurs in the thread" do
63
+ before do
64
+ aggregator = double
65
+ aggregator.stub(:has_transactions?).and_raise(
66
+ RuntimeError.new('error')
67
+ )
68
+ subject.stub(
69
+ :aggregator => aggregator,
70
+ :sleep_time => 0.1
71
+ )
72
+ end
73
+
74
+ it "should log the error" do
75
+ Appsignal.logger.should_receive(:error).
76
+ with("RuntimeError in agent thread: 'error'").
77
+ once
78
+
79
+ subject.start_thread
80
+ sleep 1
81
+ end
82
+ end
61
83
  end
62
84
 
63
85
  describe "#restart_thread" do
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.9.0.beta.1
4
+ version: 0.9.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-06-06 00:00:00.000000000 Z
15
+ date: 2014-06-27 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport
@@ -232,9 +232,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
232
232
  version: 1.9.3
233
233
  required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  requirements:
235
- - - ">"
235
+ - - ">="
236
236
  - !ruby/object:Gem::Version
237
- version: 1.3.1
237
+ version: '0'
238
238
  requirements: []
239
239
  rubyforge_project:
240
240
  rubygems_version: 2.2.2