appsignal 2.2.1 → 2.3.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/appsignal.gemspec +1 -2
- data/ext/agent.yml +11 -11
- data/ext/appsignal_extension.c +17 -1
- data/lib/appsignal/config.rb +7 -4
- data/lib/appsignal/hooks.rb +1 -6
- data/lib/appsignal/hooks/action_cable.rb +113 -0
- data/lib/appsignal/hooks/active_support_notifications.rb +12 -4
- data/lib/appsignal/hooks/shoryuken.rb +11 -11
- data/lib/appsignal/hooks/sidekiq.rb +5 -3
- data/lib/appsignal/integrations/delayed_job_plugin.rb +5 -1
- data/lib/appsignal/integrations/resque_active_job.rb +4 -1
- data/lib/appsignal/transaction.rb +40 -13
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/config_spec.rb +8 -1
- data/spec/lib/appsignal/hooks/action_cable_spec.rb +370 -0
- data/spec/lib/appsignal/hooks/active_support_notifications_spec.rb +39 -7
- data/spec/lib/appsignal/hooks/delayed_job_spec.rb +179 -34
- data/spec/lib/appsignal/hooks/shoryuken_spec.rb +125 -30
- data/spec/lib/appsignal/hooks/sidekiq_spec.rb +140 -21
- data/spec/lib/appsignal/hooks_spec.rb +0 -21
- data/spec/lib/appsignal/integrations/resque_active_job_spec.rb +62 -17
- data/spec/lib/appsignal/integrations/resque_spec.rb +24 -12
- data/spec/lib/appsignal/transaction_spec.rb +230 -91
- data/spec/spec_helper.rb +8 -2
- data/spec/support/helpers/dependency_helper.rb +4 -0
- data/spec/support/helpers/env_helpers.rb +1 -1
- data/spec/support/helpers/log_helpers.rb +17 -0
- data/spec/support/matchers/contains_log.rb +7 -0
- data/spec/support/shared_examples/instrument.rb +2 -2
- metadata +13 -20
data/spec/spec_helper.rb
CHANGED
@@ -13,10 +13,13 @@ require "pry"
|
|
13
13
|
require "timecop"
|
14
14
|
require "webmock/rspec"
|
15
15
|
|
16
|
-
Dir[File.join(APPSIGNAL_SPEC_DIR, "support
|
16
|
+
Dir[File.join(APPSIGNAL_SPEC_DIR, "support", "helpers", "*.rb")].each do |f|
|
17
17
|
require f
|
18
18
|
end
|
19
|
-
Dir[File.join(
|
19
|
+
Dir[File.join(DirectoryHelper.support_dir, "mocks", "*.rb")].each do |f|
|
20
|
+
require f
|
21
|
+
end
|
22
|
+
Dir[File.join(DirectoryHelper.support_dir, "matchers", "*.rb")].each do |f|
|
20
23
|
require f
|
21
24
|
end
|
22
25
|
Dir[File.join(APPSIGNAL_SPEC_DIR, "support/shared_examples", "*.rb")].each do |f|
|
@@ -52,8 +55,11 @@ RSpec.configure do |config|
|
|
52
55
|
config.include TransactionHelpers
|
53
56
|
config.include ApiRequestHelper
|
54
57
|
config.include SystemHelpers
|
58
|
+
config.include LogHelpers
|
55
59
|
config.extend DependencyHelper
|
56
60
|
|
61
|
+
config.fail_if_no_examples = true
|
62
|
+
|
57
63
|
config.before :context do
|
58
64
|
# Use modified SYSTEM_TMP_DIR
|
59
65
|
Appsignal::Config.send :remove_const, :SYSTEM_TMP_DIR
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module LogHelpers
|
2
|
+
def use_logger_with(log)
|
3
|
+
Appsignal.logger = Logger.new(log)
|
4
|
+
Appsignal.logger.formatter =
|
5
|
+
proc do |severity, _datetime, _progname, msg|
|
6
|
+
# This format is used in the `contains_log` matcher.
|
7
|
+
"[#{severity}] #{msg}\n"
|
8
|
+
end
|
9
|
+
yield
|
10
|
+
Appsignal.logger = nil
|
11
|
+
end
|
12
|
+
|
13
|
+
def log_contents(log)
|
14
|
+
log.rewind
|
15
|
+
log.read
|
16
|
+
end
|
17
|
+
end
|
@@ -24,9 +24,9 @@ RSpec.shared_examples "instrument helper" do
|
|
24
24
|
expect do
|
25
25
|
instrumenter.instrument "name", "title", "body" do
|
26
26
|
stub.method_call
|
27
|
-
raise "foo"
|
27
|
+
raise VerySpecificError, "foo"
|
28
28
|
end
|
29
|
-
end.to raise_error(
|
29
|
+
end.to raise_error(VerySpecificError, "foo")
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
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.
|
4
|
+
version: 2.3.0.beta.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: 2017-
|
12
|
+
date: 2017-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -25,20 +25,6 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: thread_safe
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - ">="
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '0'
|
35
|
-
type: :runtime
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '0'
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
29
|
name: rake
|
44
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,14 +45,14 @@ dependencies:
|
|
59
45
|
requirements:
|
60
46
|
- - "~>"
|
61
47
|
- !ruby/object:Gem::Version
|
62
|
-
version: '3.
|
48
|
+
version: '3.6'
|
63
49
|
type: :development
|
64
50
|
prerelease: false
|
65
51
|
version_requirements: !ruby/object:Gem::Requirement
|
66
52
|
requirements:
|
67
53
|
- - "~>"
|
68
54
|
- !ruby/object:Gem::Version
|
69
|
-
version: '3.
|
55
|
+
version: '3.6'
|
70
56
|
- !ruby/object:Gem::Dependency
|
71
57
|
name: pry
|
72
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,6 +187,7 @@ files:
|
|
201
187
|
- lib/appsignal/extension.rb
|
202
188
|
- lib/appsignal/garbage_collection_profiler.rb
|
203
189
|
- lib/appsignal/hooks.rb
|
190
|
+
- lib/appsignal/hooks/action_cable.rb
|
204
191
|
- lib/appsignal/hooks/active_support_notifications.rb
|
205
192
|
- lib/appsignal/hooks/celluloid.rb
|
206
193
|
- lib/appsignal/hooks/data_mapper.rb
|
@@ -270,6 +257,7 @@ files:
|
|
270
257
|
- spec/lib/appsignal/event_formatter_spec.rb
|
271
258
|
- spec/lib/appsignal/extension_spec.rb
|
272
259
|
- spec/lib/appsignal/garbage_collection_profiler_spec.rb
|
260
|
+
- spec/lib/appsignal/hooks/action_cable_spec.rb
|
273
261
|
- spec/lib/appsignal/hooks/active_support_notifications_spec.rb
|
274
262
|
- spec/lib/appsignal/hooks/celluloid_spec.rb
|
275
263
|
- spec/lib/appsignal/hooks/data_mapper_spec.rb
|
@@ -325,11 +313,13 @@ files:
|
|
325
313
|
- spec/support/helpers/dependency_helper.rb
|
326
314
|
- spec/support/helpers/directory_helper.rb
|
327
315
|
- spec/support/helpers/env_helpers.rb
|
316
|
+
- spec/support/helpers/log_helpers.rb
|
328
317
|
- spec/support/helpers/std_streams_helper.rb
|
329
318
|
- spec/support/helpers/system_helpers.rb
|
330
319
|
- spec/support/helpers/time_helpers.rb
|
331
320
|
- spec/support/helpers/transaction_helpers.rb
|
332
321
|
- spec/support/helpers/very_specific_error.rb
|
322
|
+
- spec/support/matchers/contains_log.rb
|
333
323
|
- spec/support/mocks/fake_gc_profiler.rb
|
334
324
|
- spec/support/mocks/mock_extension.rb
|
335
325
|
- spec/support/project_fixture/config/application.rb
|
@@ -357,9 +347,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
357
347
|
version: '1.9'
|
358
348
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
359
349
|
requirements:
|
360
|
-
- - "
|
350
|
+
- - ">"
|
361
351
|
- !ruby/object:Gem::Version
|
362
|
-
version:
|
352
|
+
version: 1.3.1
|
363
353
|
requirements: []
|
364
354
|
rubyforge_project:
|
365
355
|
rubygems_version: 2.6.12
|
@@ -389,6 +379,7 @@ test_files:
|
|
389
379
|
- spec/lib/appsignal/event_formatter_spec.rb
|
390
380
|
- spec/lib/appsignal/extension_spec.rb
|
391
381
|
- spec/lib/appsignal/garbage_collection_profiler_spec.rb
|
382
|
+
- spec/lib/appsignal/hooks/action_cable_spec.rb
|
392
383
|
- spec/lib/appsignal/hooks/active_support_notifications_spec.rb
|
393
384
|
- spec/lib/appsignal/hooks/celluloid_spec.rb
|
394
385
|
- spec/lib/appsignal/hooks/data_mapper_spec.rb
|
@@ -444,11 +435,13 @@ test_files:
|
|
444
435
|
- spec/support/helpers/dependency_helper.rb
|
445
436
|
- spec/support/helpers/directory_helper.rb
|
446
437
|
- spec/support/helpers/env_helpers.rb
|
438
|
+
- spec/support/helpers/log_helpers.rb
|
447
439
|
- spec/support/helpers/std_streams_helper.rb
|
448
440
|
- spec/support/helpers/system_helpers.rb
|
449
441
|
- spec/support/helpers/time_helpers.rb
|
450
442
|
- spec/support/helpers/transaction_helpers.rb
|
451
443
|
- spec/support/helpers/very_specific_error.rb
|
444
|
+
- spec/support/matchers/contains_log.rb
|
452
445
|
- spec/support/mocks/fake_gc_profiler.rb
|
453
446
|
- spec/support/mocks/mock_extension.rb
|
454
447
|
- spec/support/project_fixture/config/application.rb
|