appsignal 3.1.1 → 3.1.4
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 +40 -0
- data/appsignal.gemspec +5 -1
- data/ext/agent.yml +32 -25
- data/lib/appsignal/config.rb +0 -3
- data/lib/appsignal/garbage_collection.rb +90 -0
- data/lib/appsignal/helpers/instrumentation.rb +8 -5
- data/lib/appsignal/hooks/active_job.rb +5 -5
- data/lib/appsignal/integrations/mongo_ruby_driver.rb +4 -2
- data/lib/appsignal/integrations/sidekiq.rb +18 -15
- data/lib/appsignal/probes/helpers.rb +21 -8
- data/lib/appsignal/probes/mri.rb +18 -18
- data/lib/appsignal/probes/sidekiq.rb +7 -6
- data/lib/appsignal/rack/rails_instrumentation.rb +5 -1
- data/lib/appsignal/transaction.rb +19 -12
- data/lib/appsignal/version.rb +1 -1
- data/lib/appsignal.rb +1 -6
- data/spec/lib/appsignal/config_spec.rb +0 -1
- data/spec/lib/appsignal/{garbage_collection_profiler_spec.rb → garbage_collection_spec.rb} +28 -6
- data/spec/lib/appsignal/probes/mri_spec.rb +66 -3
- data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +79 -35
- data/spec/lib/appsignal/transaction_spec.rb +19 -34
- data/spec/lib/appsignal_spec.rb +10 -23
- data/spec/support/helpers/env_helpers.rb +9 -1
- data/spec/support/helpers/transaction_helpers.rb +6 -0
- data/spec/support/testing.rb +11 -0
- metadata +12 -12
- data/lib/appsignal/garbage_collection_profiler.rb +0 -61
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: 3.1.
|
4
|
+
version: 3.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-08-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -69,35 +69,35 @@ dependencies:
|
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
|
-
name:
|
72
|
+
name: yard
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 0.9.20
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
82
|
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
84
|
+
version: 0.9.20
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
86
|
+
name: pry
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
89
|
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0
|
91
|
+
version: '0'
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0
|
98
|
+
version: '0'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
|
-
name:
|
100
|
+
name: webmock
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
103
|
- - ">="
|
@@ -204,7 +204,7 @@ files:
|
|
204
204
|
- lib/appsignal/event_formatter/sequel/sql_formatter.rb
|
205
205
|
- lib/appsignal/extension.rb
|
206
206
|
- lib/appsignal/extension/jruby.rb
|
207
|
-
- lib/appsignal/
|
207
|
+
- lib/appsignal/garbage_collection.rb
|
208
208
|
- lib/appsignal/helpers/instrumentation.rb
|
209
209
|
- lib/appsignal/helpers/metrics.rb
|
210
210
|
- lib/appsignal/hooks.rb
|
@@ -305,7 +305,7 @@ files:
|
|
305
305
|
- spec/lib/appsignal/extension/jruby_spec.rb
|
306
306
|
- spec/lib/appsignal/extension_install_failure_spec.rb
|
307
307
|
- spec/lib/appsignal/extension_spec.rb
|
308
|
-
- spec/lib/appsignal/
|
308
|
+
- spec/lib/appsignal/garbage_collection_spec.rb
|
309
309
|
- spec/lib/appsignal/hooks/action_cable_spec.rb
|
310
310
|
- spec/lib/appsignal/hooks/action_mailer_spec.rb
|
311
311
|
- spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
|
@@ -457,7 +457,7 @@ test_files:
|
|
457
457
|
- spec/lib/appsignal/extension/jruby_spec.rb
|
458
458
|
- spec/lib/appsignal/extension_install_failure_spec.rb
|
459
459
|
- spec/lib/appsignal/extension_spec.rb
|
460
|
-
- spec/lib/appsignal/
|
460
|
+
- spec/lib/appsignal/garbage_collection_spec.rb
|
461
461
|
- spec/lib/appsignal/hooks/action_cable_spec.rb
|
462
462
|
- spec/lib/appsignal/hooks/action_mailer_spec.rb
|
463
463
|
- spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
|
@@ -1,61 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Appsignal
|
4
|
-
# {Appsignal::GarbageCollectionProfiler} wraps Ruby's `GC::Profiler` to be
|
5
|
-
# able to track garbage collection time for multiple transactions, while
|
6
|
-
# constantly clearing `GC::Profiler`'s total_time to make sure it doesn't
|
7
|
-
# leak memory by keeping garbage collection run samples in memory.
|
8
|
-
#
|
9
|
-
# @api private
|
10
|
-
class GarbageCollectionProfiler
|
11
|
-
def self.lock
|
12
|
-
@lock ||= Mutex.new
|
13
|
-
end
|
14
|
-
|
15
|
-
def initialize
|
16
|
-
@total_time = 0
|
17
|
-
end
|
18
|
-
|
19
|
-
# Whenever {#total_time} is called, the current `GC::Profiler#total_time`
|
20
|
-
# gets added to `@total_time`, after which `GC::Profiler.clear` is called
|
21
|
-
# to prevent it from leaking memory. A class-level lock is used to make
|
22
|
-
# sure garbage collection time is never counted more than once.
|
23
|
-
#
|
24
|
-
# Whenever `@total_time` gets above two billion milliseconds (about 23
|
25
|
-
# days), it's reset to make sure the result fits in a signed 32-bit
|
26
|
-
# integer.
|
27
|
-
#
|
28
|
-
# @return [Integer]
|
29
|
-
def total_time
|
30
|
-
lock.synchronize do
|
31
|
-
@total_time += (internal_profiler.total_time * 1000).round
|
32
|
-
internal_profiler.clear
|
33
|
-
end
|
34
|
-
|
35
|
-
@total_time = 0 if @total_time > 2_000_000_000
|
36
|
-
|
37
|
-
@total_time
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
|
42
|
-
def internal_profiler
|
43
|
-
GC::Profiler
|
44
|
-
end
|
45
|
-
|
46
|
-
def lock
|
47
|
-
self.class.lock
|
48
|
-
end
|
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
|
61
|
-
end
|