appsignal 0.8.12 → 0.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/appsignal/agent.rb +1 -1
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/agent_spec.rb +24 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d56f0e2c7ba6fbe1d96a774a8815a1380c58ef4a
|
4
|
+
data.tar.gz: 2fa915ae48dfab0388a99b1add175ec25922fcbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cb9285900da9c130e403b80bbdad656072b315ee4e04e469357a74d09e5008aedb4bda6966d3a7c44c8136a0eb8876583a788efe69970248647101ca785872a
|
7
|
+
data.tar.gz: d53de5f4a411ba6a663952a0b4d5a59f958550b918088dc90f56e398df9dcf3657b807d51f806e8de37967c4db8d1b8fa367574a1914b9592cc6dea26a2f3ec8
|
data/CHANGELOG.md
CHANGED
data/lib/appsignal/agent.rb
CHANGED
@@ -24,8 +24,8 @@ 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))
|
27
28
|
loop do
|
28
|
-
Appsignal.logger.debug aggregator.queue.inspect
|
29
29
|
send_queue if aggregator.has_transactions?
|
30
30
|
Appsignal.logger.debug("Sleeping #{sleep_time}")
|
31
31
|
sleep(sleep_time)
|
data/lib/appsignal/version.rb
CHANGED
@@ -32,16 +32,35 @@ describe Appsignal::Agent do
|
|
32
32
|
describe "#start_thread" do
|
33
33
|
before { subject.thread = nil }
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
context "without transactions" do
|
36
|
+
it "should start and run a background thread" do
|
37
|
+
subject.should_not_receive(:send_queue)
|
37
38
|
|
38
|
-
|
39
|
-
|
39
|
+
subject.start_thread
|
40
|
+
|
41
|
+
subject.thread.should be_a(Thread)
|
42
|
+
subject.thread.should be_alive
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context "with transactions" do
|
47
|
+
before do
|
48
|
+
subject.stub(
|
49
|
+
:aggregator => double(:has_transactions? => true),
|
50
|
+
:sleep_time => 0.1
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should send the queue and sleep" do
|
55
|
+
subject.should_receive(:send_queue).at_least(:twice)
|
56
|
+
|
57
|
+
subject.start_thread
|
58
|
+
sleep 1
|
59
|
+
end
|
40
60
|
end
|
41
61
|
end
|
42
62
|
|
43
63
|
describe "#restart_thread" do
|
44
|
-
|
45
64
|
it "should stop thread" do
|
46
65
|
subject.should_receive(:stop_thread)
|
47
66
|
end
|