appsignal 2.8.4.beta.1 → 2.8.4

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
  SHA256:
3
- metadata.gz: 18e35e36c20569d76c5e0c0760b1099614accde67e2ae178e22f5f56b9829331
4
- data.tar.gz: bb171143986af96d4f40f29961abfa8812e80297f37ec5a79de9940a2db24249
3
+ metadata.gz: b3fc30ece50f7e8fae3c7f6307ce2f3b4da2cc141b316cc91df6554ad9bdd3cd
4
+ data.tar.gz: dd0be2f1ad3aa160925d6ab1fba7ccd90ac03a06b8907f29d4c381d368fad0b3
5
5
  SHA512:
6
- metadata.gz: 57555a3eeaa49604929d2b3c18147e9a3b25b4fbb26ed70af99750d2d8f34abcafdb4b5c2582b1ee399217a442eae7dbb51af5378bc6f0b55189368eee223256
7
- data.tar.gz: 7c0ce94dcd2b9948d0def579bfc89651496e439b1d62b962867b2805430bc8a036f37d648d1fb19305b99910cd43f59745bff0b53327f11e12e3b6dd419a10ed
6
+ metadata.gz: e1fb4406cbaa4c2b8337f762360ef97e76cbc89153529f81656b068d5c70b6ba99c8a835c18b546fbcbc396eba95c39eaba46f95adf544cf9b4158b9e4f79e41
7
+ data.tar.gz: 4750be78260f6c04d9db137e6013acc2b8a481f3795b9471619cc9b2078dc83c840cfbd50f260d86fe9f774becefd6963399777abea5b111dfd7f3e1f4fe1b79
@@ -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: ruby
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
@@ -370,12 +370,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
370
370
  version: '1.9'
371
371
  required_rubygems_version: !ruby/object:Gem::Requirement
372
372
  requirements:
373
- - - ">"
373
+ - - ">="
374
374
  - !ruby/object:Gem::Version
375
- version: 1.3.1
375
+ version: '0'
376
376
  requirements: []
377
- rubyforge_project:
378
- rubygems_version: 2.7.6
377
+ rubygems_version: 3.0.2
379
378
  signing_key:
380
379
  specification_version: 4
381
380
  summary: Logs performance and exception data from your app to appsignal.com