appsignal 2.7.0 → 2.7.1

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: d828cca6d5a9ec2b478a06c63a55a036f546d9ff0b725353ef43c377b012bf62
4
- data.tar.gz: 7d0f98c13409d78b7a5c0888c5d0e6ae9d56fd384f47d55c7a731c8a071d4b76
3
+ metadata.gz: 958814ee490ee3e9939d056c6733eb198613a1411e55b21d66d530ed9168c8ef
4
+ data.tar.gz: 4d1043dbf6f6ce145378068b00e71f9d7041017a32631e2e6ab061e38bfa5e89
5
5
  SHA512:
6
- metadata.gz: caaca0b6b43feefd2c340071599fb68c6a583d7f47cdbf8d0307772e59306b0d88b6b08c5fccf1f407661794c787b71711f45a2d53e4f936f3c7f7a22861069f
7
- data.tar.gz: 7093e7a762e3b34998ae9ab1476c75bbb5696ddbc50e33696db4c63477fdb489ee87b5a074b8558e8a11bbce7649e6d09ddeca26b7c92c515ad84c9b52cf2594
6
+ metadata.gz: 1b96e28295754d5fad3010b714fc7d594ec732ab0b15d22f61db5320ee9563dd9155ff7e4bd7fa1ea632933ba90e11f1a665f3d353102be2e35a2f549152e46e
7
+ data.tar.gz: 042da1fbb9c27a823638d78e38d231bd9f34dd59621c17b7ac029fdcf6df24335f4b07614adecea8e77224e9499486325c609054e0e139389905d793cebe1802
@@ -1,3 +1,8 @@
1
+ # 2.7.1
2
+ - Improve error log on unsupported architecture and build combination on
3
+ install. PR #426
4
+ - Improve performance when garbage collection profiling is disabled. PR #429
5
+
1
6
  # 2.7.0
2
7
  - Detect Kubernetes containers as containers for `running_in_container`
3
8
  config option. Commit 60822aac24ccc394df073091c64f05096455942d.
@@ -15,6 +15,7 @@ task :default do
15
15
  ) &&
16
16
  File.exist?(ext_path("appsignal.h"))
17
17
  archive = download_archive(arch_config, "dynamic")
18
+ next unless archive
18
19
  next unless verify_archive(archive, arch_config, "dynamic")
19
20
  unarchive(archive)
20
21
  end
@@ -36,7 +36,7 @@ def write_agent_architecture
36
36
  end
37
37
 
38
38
  def check_architecture
39
- if AGENT_CONFIG["triples"].keys.include?(ARCH)
39
+ if AGENT_CONFIG["triples"].key?(ARCH)
40
40
  true
41
41
  else
42
42
  installation_failed(
@@ -48,8 +48,18 @@ def check_architecture
48
48
  end
49
49
 
50
50
  def download_archive(arch_config, type)
51
- logger.info "Downloading agent release from #{arch_config[type]["download_url"]}"
52
- open(arch_config[type]["download_url"], :ssl_ca_cert => CA_CERT_PATH)
51
+ if arch_config.key?(type)
52
+ logger.info "Downloading agent release from #{arch_config[type]["download_url"]}"
53
+ open(arch_config[type]["download_url"], :ssl_ca_cert => CA_CERT_PATH)
54
+ else
55
+ installation_failed(
56
+ "AppSignal currently does not support your system. " \
57
+ "Expected config for architecture '#{ARCH}' and package type '#{type}', but none found. " \
58
+ "For a full list of supported systems visit: " \
59
+ "https://docs.appsignal.com/support/operating-systems.html"
60
+ )
61
+ false
62
+ end
53
63
  end
54
64
 
55
65
  def verify_archive(archive, arch_config, type)
@@ -11,6 +11,7 @@ def install
11
11
  File.exist?(ext_path("libappsignal.a")) &&
12
12
  File.exist?(ext_path("appsignal.h"))
13
13
  archive = download_archive(arch_config, "static")
14
+ return unless archive
14
15
  return unless verify_archive(archive, arch_config, "static")
15
16
  unarchive(archive)
16
17
  end
@@ -47,4 +47,15 @@ module Appsignal
47
47
  self.class.lock
48
48
  end
49
49
  end
50
+
51
+ # {Appsignal::NilGarbageCollectionProfiler} is a dummy profiler
52
+ # that always returns 0 as the total time.
53
+ # Used when we don't want any profile information
54
+ #
55
+ # @api private
56
+ class NilGarbageCollectionProfiler
57
+ def total_time
58
+ 0
59
+ end
60
+ end
50
61
  end
@@ -53,7 +53,8 @@ module Appsignal
53
53
  end
54
54
 
55
55
  def garbage_collection_profiler
56
- @garbage_collection_profiler ||= Appsignal::GarbageCollectionProfiler.new
56
+ @garbage_collection_profiler ||=
57
+ Appsignal.config[:enable_gc_instrumentation] ? Appsignal::GarbageCollectionProfiler.new : NilGarbageCollectionProfiler.new
57
58
  end
58
59
  end
59
60
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "2.7.0".freeze
4
+ VERSION = "2.7.1".freeze
5
5
  end
@@ -64,3 +64,13 @@ describe Appsignal::GarbageCollectionProfiler do
64
64
  end
65
65
  end
66
66
  end
67
+
68
+ describe Appsignal::NilGarbageCollectionProfiler do
69
+ let(:profiler) { described_class.new }
70
+
71
+ describe "#total_time" do
72
+ it "has a total time of 0" do
73
+ expect(profiler.total_time).to eq(0)
74
+ end
75
+ end
76
+ end
@@ -672,6 +672,23 @@ describe Appsignal::Transaction do
672
672
  end
673
673
  end
674
674
 
675
+ describe "#garbage_collection_profiler" do
676
+ before { Appsignal::Transaction.instance_variable_set(:@garbage_collection_profiler, nil) }
677
+
678
+ it "returns the NilGarbageCollectionProfiler" do
679
+ expect(Appsignal::Transaction.garbage_collection_profiler).to be_a(Appsignal::NilGarbageCollectionProfiler)
680
+ end
681
+
682
+ context "when gc profiling is enabled" do
683
+ before { Appsignal.config.config_hash[:enable_gc_instrumentation] = true }
684
+ after { Appsignal.config.config_hash[:enable_gc_instrumentation] = false }
685
+
686
+ it "returns the GarbageCollectionProfiler" do
687
+ expect(Appsignal::Transaction.garbage_collection_profiler).to be_a(Appsignal::GarbageCollectionProfiler)
688
+ end
689
+ end
690
+ end
691
+
675
692
  describe "#start_event" do
676
693
  it "should start the event in the extension" do
677
694
  expect(transaction.ext).to receive(:start_event).with(0).and_call_original
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.7.0
4
+ version: 2.7.1
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: 2018-08-13 00:00:00.000000000 Z
12
+ date: 2018-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack