appsignal 0.11.13.beta.0 → 0.11.13.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +1 -0
- data/lib/appsignal/agent.rb +3 -0
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/agent_spec.rb +47 -25
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/lib/appsignal/agent.rb
CHANGED
@@ -103,6 +103,9 @@ module Appsignal
|
|
103
103
|
|
104
104
|
def send_queue
|
105
105
|
Appsignal.logger.debug('Sending queue')
|
106
|
+
unless aggregator.has_transactions? || aggregator_queue.any?
|
107
|
+
return
|
108
|
+
end
|
106
109
|
# Replace aggregator while making sure no thread
|
107
110
|
# is adding to it's queue
|
108
111
|
aggregator_to_be_sent = nil
|
data/lib/appsignal/version.rb
CHANGED
@@ -271,39 +271,61 @@ describe Appsignal::Agent do
|
|
271
271
|
describe "#send_queue" do
|
272
272
|
let(:zipped_payload) { double(:body => :zip) }
|
273
273
|
|
274
|
-
|
275
|
-
|
274
|
+
context "with something in the aggregator" do
|
275
|
+
before do
|
276
|
+
subject.aggregator.stub(:has_transactions? => true)
|
277
|
+
end
|
276
278
|
|
277
|
-
|
278
|
-
.
|
279
|
-
.with(:foo)
|
280
|
-
.and_return(zipped_payload)
|
279
|
+
it "adds Zipped Payload to queue" do
|
280
|
+
subject.aggregator.stub(:post_processed_queue! => :foo)
|
281
281
|
|
282
|
-
|
283
|
-
|
282
|
+
Appsignal::ZippedPayload
|
283
|
+
.should_receive(:new)
|
284
|
+
.with(:foo)
|
285
|
+
.and_return(zipped_payload)
|
284
286
|
|
285
|
-
|
286
|
-
|
287
|
-
end
|
287
|
+
subject.should_receive(:add_to_aggregator_queue).with(zipped_payload)
|
288
|
+
end
|
288
289
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
)
|
290
|
+
it "sends aggregators" do
|
291
|
+
subject.should_receive(:send_aggregators)
|
292
|
+
end
|
293
293
|
|
294
|
-
|
295
|
-
|
296
|
-
|
294
|
+
it "handle exceptions in post processing" do
|
295
|
+
subject.aggregator.stub(:post_processed_queue!).and_raise(
|
296
|
+
PostProcessingException.new('Message')
|
297
|
+
)
|
298
|
+
|
299
|
+
Appsignal.logger.should_receive(:error).
|
300
|
+
with(kind_of(String)).
|
301
|
+
once
|
302
|
+
end
|
303
|
+
|
304
|
+
it "handles exceptions in transmit" do
|
305
|
+
subject.stub(:send_aggregators).and_raise(
|
306
|
+
Exception.new('Message')
|
307
|
+
)
|
308
|
+
|
309
|
+
Appsignal.logger.should_receive(:error).
|
310
|
+
with(kind_of(String)).
|
311
|
+
once
|
312
|
+
end
|
297
313
|
end
|
298
314
|
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
315
|
+
context "with something in the aggregator queue" do
|
316
|
+
before do
|
317
|
+
subject.aggregator_queue.stub(:any? => true)
|
318
|
+
end
|
303
319
|
|
304
|
-
|
305
|
-
|
306
|
-
|
320
|
+
it "sends aggregators" do
|
321
|
+
subject.should_receive(:send_aggregators)
|
322
|
+
end
|
323
|
+
end
|
324
|
+
|
325
|
+
context "with empty aggregator and aggregator queue" do
|
326
|
+
it "does not send aggregators" do
|
327
|
+
subject.should_not_receive(:send_aggregators)
|
328
|
+
end
|
307
329
|
end
|
308
330
|
|
309
331
|
after { subject.send_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.13.beta.
|
4
|
+
version: 0.11.13.beta.1
|
5
5
|
prerelease: 8
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2015-07-
|
16
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: rack
|