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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/appsignal/agent.rb +10 -5
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/agent_spec.rb +22 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 226f414f32b34a19319e026fd18d46eba9e099c3
|
4
|
+
data.tar.gz: 5bf409703a3c98fc0c69813e7113b58eff4e3d08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaeae87208d56bf8572de0b6644a52d39f5a01b1d152ff3d67022edb1ad4b6d922adc9265f4a46bf3d357b93bc1411fba26e662ba43fc8e67c5b15d15bdadb76
|
7
|
+
data.tar.gz: 1cea5690d17117fd5f7c35ce3c4883164ea4cb8958a37bd199a8c93c58bb788d26b193daf5562cf3c5d7499331f4d716b1ac2d6fc39a7a53254314d7604acba2
|
data/CHANGELOG.md
CHANGED
data/lib/appsignal/agent.rb
CHANGED
@@ -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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
data/lib/appsignal/version.rb
CHANGED
@@ -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
|
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-
|
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:
|
237
|
+
version: '0'
|
238
238
|
requirements: []
|
239
239
|
rubyforge_project:
|
240
240
|
rubygems_version: 2.2.2
|