appsignal 2.8.4.beta.1-java → 2.8.4-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89bf9c6f5a93f01db3a5b50e68b02492dfb36b6ee5af1b9188c5dc8af98ca2a4
4
- data.tar.gz: bb171143986af96d4f40f29961abfa8812e80297f37ec5a79de9940a2db24249
3
+ metadata.gz: a6c51056cc45697339edad0c7229bea1d7097fc4e7c339197fcd4a41c65b9ba2
4
+ data.tar.gz: fb18f33d2c554adeea7181b36e0eb9dc3556a7d165e67b7a3e827586c42ca845
5
5
  SHA512:
6
- metadata.gz: bfdd988fe0b33d6aea24d2758bf4cd269292277fe3d00373360f870a1af1b53ed26a7fddaac6260f29caa016e7b43e8fab5ac7ded847a5188d168b055c9637a2
7
- data.tar.gz: 7c0ce94dcd2b9948d0def579bfc89651496e439b1d62b962867b2805430bc8a036f37d648d1fb19305b99910cd43f59745bff0b53327f11e12e3b6dd419a10ed
6
+ metadata.gz: fe31ea0e9ce501ab473a0813d81c1d5191ddbc5fc99265633393a497d8a89aa7cf6e19778fa0ceda621c5eac0fbedc12176caf6f80eb3879638a60419075bfda
7
+ data.tar.gz: 3e1c72e0b453e4aa2d758efa511aff1735039dd442121f00dba87ef52b04912c031400dc6acd52e35920c55244f05dd41afd118953e4b14958d0381a198888da
@@ -1,5 +1,7 @@
1
1
  # 2.8.4
2
- - Log memory usage of agent if high
2
+ - Log memory usage of agent if high.
3
+ Commit 46cf3770e13eff9f5fccbf8a4525a8dbfd8eeaad
4
+ - Fix `Appsignal::Transaction.pause!`. PR #482
3
5
 
4
6
  # 2.8.3
5
7
  - Fix multi user permission issue for agent directories and files.
@@ -752,7 +752,7 @@ module Appsignal
752
752
  end
753
753
  deprecate :is_ignored_action?, :none, 2017, 3
754
754
 
755
- # Convenience method for skipping instrumentations around a block of code.
755
+ # Convenience method for skipping instrumentation around a block of code.
756
756
  #
757
757
  # @example
758
758
  # Appsignal.without_instrumentation do
@@ -277,10 +277,12 @@ module Appsignal
277
277
  alias_method :add_exception, :set_error
278
278
 
279
279
  def start_event
280
+ return if paused?
280
281
  @ext.start_event(self.class.garbage_collection_profiler.total_time)
281
282
  end
282
283
 
283
284
  def finish_event(name, title, body, body_format = Appsignal::EventFormatter::DEFAULT)
285
+ return if paused?
284
286
  @ext.finish_event(
285
287
  name,
286
288
  title || BLANK,
@@ -291,6 +293,7 @@ module Appsignal
291
293
  end
292
294
 
293
295
  def record_event(name, title, body, duration, body_format = Appsignal::EventFormatter::DEFAULT)
296
+ return if paused?
294
297
  @ext.record_event(
295
298
  name,
296
299
  title || BLANK,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "2.8.4.beta.1".freeze
4
+ VERSION = "2.8.4".freeze
5
5
  end
@@ -214,7 +214,7 @@ describe Appsignal::Transaction do
214
214
 
215
215
  context "pausing" do
216
216
  describe "#pause!" do
217
- it "should change the pause flag to true" do
217
+ it "changes the pause flag to true" do
218
218
  expect do
219
219
  transaction.pause!
220
220
  end.to change(transaction, :paused).from(false).to(true)
@@ -224,7 +224,7 @@ describe Appsignal::Transaction do
224
224
  describe "#resume!" do
225
225
  before { transaction.pause! }
226
226
 
227
- it "should change the pause flag to false" do
227
+ it "changes the pause flag to false" do
228
228
  expect do
229
229
  transaction.resume!
230
230
  end.to change(transaction, :paused).from(true).to(false)
@@ -232,14 +232,16 @@ describe Appsignal::Transaction do
232
232
  end
233
233
 
234
234
  describe "#paused?" do
235
- it "should return the pause state" do
236
- expect(transaction.paused?).to be_falsy
235
+ context "when not paused" do
236
+ it "return false" do
237
+ expect(transaction.paused?).to be_falsy
238
+ end
237
239
  end
238
240
 
239
241
  context "when paused" do
240
242
  before { transaction.pause! }
241
243
 
242
- it "should return the pause state" do
244
+ it "returns true" do
243
245
  expect(transaction.paused?).to be_truthy
244
246
  end
245
247
  end
@@ -690,11 +692,20 @@ describe Appsignal::Transaction do
690
692
  end
691
693
 
692
694
  describe "#start_event" do
693
- it "should start the event in the extension" do
695
+ it "starts the event in the extension" do
694
696
  expect(transaction.ext).to receive(:start_event).with(0).and_call_original
695
697
 
696
698
  transaction.start_event
697
699
  end
700
+
701
+ context "when transaction is paused" do
702
+ it "does not start the event" do
703
+ transaction.pause!
704
+ expect(transaction.ext).to_not receive(:start_event)
705
+
706
+ transaction.start_event
707
+ end
708
+ end
698
709
  end
699
710
 
700
711
  describe "#finish_event" do
@@ -737,6 +748,15 @@ describe Appsignal::Transaction do
737
748
  nil
738
749
  )
739
750
  end
751
+
752
+ context "when transaction is paused" do
753
+ it "does not finish the event" do
754
+ transaction.pause!
755
+ expect(transaction.ext).to_not receive(:finish_event)
756
+
757
+ transaction.start_event
758
+ end
759
+ end
740
760
  end
741
761
 
742
762
  describe "#record_event" do
@@ -783,6 +803,21 @@ describe Appsignal::Transaction do
783
803
  nil
784
804
  )
785
805
  end
806
+
807
+ context "when transaction is paused" do
808
+ it "does not record the event" do
809
+ transaction.pause!
810
+ expect(transaction.ext).to_not receive(:record_event)
811
+
812
+ transaction.record_event(
813
+ "name",
814
+ nil,
815
+ nil,
816
+ 1000,
817
+ nil
818
+ )
819
+ end
820
+ end
786
821
  end
787
822
 
788
823
  describe "#instrument" do
@@ -831,25 +831,25 @@ describe Appsignal do
831
831
  end
832
832
 
833
833
  describe ".without_instrumentation" do
834
- let(:transaction) { double }
834
+ let(:transaction) { http_request_transaction }
835
835
  before { allow(Appsignal::Transaction).to receive(:current).and_return(transaction) }
836
836
 
837
- it "should pause and unpause the transaction around the block" do
838
- expect(transaction).to receive(:pause!)
839
- expect(transaction).to receive(:resume!)
837
+ it "does not record events on the transaction" do
838
+ expect(transaction).to receive(:pause!).and_call_original
839
+ expect(transaction).to receive(:resume!).and_call_original
840
+ Appsignal.instrument("register.this.event") { :do_nothing }
841
+ Appsignal.without_instrumentation do
842
+ Appsignal.instrument("dont.register.this.event") { :do_nothing }
843
+ end
844
+ expect(transaction.to_h["events"].map { |e| e["name"] })
845
+ .to match_array("register.this.event")
840
846
  end
841
847
 
842
848
  context "without transaction" do
843
849
  let(:transaction) { nil }
844
850
 
845
851
  it "should not crash" do
846
- # just execute the after block
847
- end
848
- end
849
-
850
- after do
851
- Appsignal.without_instrumentation do
852
- # nothing
852
+ Appsignal.without_instrumentation { :do_nothing }
853
853
  end
854
854
  end
855
855
  end
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: 2.8.4.beta.1
4
+ version: 2.8.4
5
5
  platform: java
6
6
  authors:
7
7
  - Robert Beekman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-02-22 00:00:00.000000000 Z
12
+ date: 2019-02-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -384,12 +384,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
384
384
  version: '1.9'
385
385
  required_rubygems_version: !ruby/object:Gem::Requirement
386
386
  requirements:
387
- - - ">"
387
+ - - ">="
388
388
  - !ruby/object:Gem::Version
389
- version: 1.3.1
389
+ version: '0'
390
390
  requirements: []
391
- rubyforge_project:
392
- rubygems_version: 2.7.6
391
+ rubygems_version: 3.0.2
393
392
  signing_key:
394
393
  specification_version: 4
395
394
  summary: Logs performance and exception data from your app to appsignal.com