appsignal 0.11.17 → 0.11.18
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 +4 -0
- data/Rakefile +1 -0
- data/gemfiles/resque.gemfile +5 -0
- data/lib/appsignal/integrations/rake.rb +1 -5
- data/lib/appsignal/integrations/resque.rb +0 -3
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/integrations/rake_spec.rb +2 -11
- data/spec/lib/appsignal/integrations/resque_spec.rb +55 -51
- data/spec/spec_helper.rb +7 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4204e0aa127219cae272542349aa109cfb4445df
|
4
|
+
data.tar.gz: c9100565b00cadfee94feeec9ddc8cc5bbce0c19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 710507253fcf8873605f60638d2806ff4f08fcd59adc45a0b879eef9c2c63b87f7aad63b6abcaafb2f974f3370bafe9ccefe914c97cee68d6e6428c81e50933a
|
7
|
+
data.tar.gz: 75ab971b694c0cd2630e5fb4b5615b13b522d7c01b8859f4136391af4bdeed576af41c84628e1e6f65cbc98ede4aea1187360228c88b911e877a3f9207410835
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -3,11 +3,7 @@ module Rake
|
|
3
3
|
alias_method :invoke_without_appsignal, :invoke
|
4
4
|
|
5
5
|
def invoke(*args)
|
6
|
-
|
7
|
-
invoke_with_appsignal(*args)
|
8
|
-
else
|
9
|
-
invoke_without_appsignal(*args)
|
10
|
-
end
|
6
|
+
invoke_with_appsignal(*args)
|
11
7
|
end
|
12
8
|
|
13
9
|
def invoke_with_appsignal(*args)
|
data/lib/appsignal/version.rb
CHANGED
@@ -13,22 +13,13 @@ describe "Rack integration" do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
describe "#invoke" do
|
16
|
-
before { Appsignal.stub(:active? => true) }
|
17
16
|
|
18
17
|
it "should call with appsignal monitoring" do
|
19
18
|
expect( task ).to receive(:invoke_with_appsignal).with(['foo'])
|
20
19
|
end
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
it "should NOT call with appsignal monitoring" do
|
26
|
-
expect( task ).to_not receive(:invoke_with_appsignal).with(['foo'])
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should call the original task" do
|
30
|
-
expect( task ).to receive(:invoke_without_appsignal).with(['foo'])
|
31
|
-
end
|
21
|
+
it "should call the original task" do
|
22
|
+
expect( task ).to receive(:invoke_without_appsignal).with(['foo'])
|
32
23
|
end
|
33
24
|
|
34
25
|
after { task.invoke(['foo']) }
|
@@ -1,78 +1,82 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
if resque_present?
|
4
|
+
describe "Resque integration" do
|
5
|
+
let(:file) { File.expand_path('lib/appsignal/integrations/resque.rb') }
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
context "with resque" do
|
8
|
+
before do
|
9
|
+
load file
|
10
|
+
start_agent
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
+
class TestJob
|
13
|
+
extend Appsignal::Integrations::ResquePlugin
|
12
14
|
|
13
|
-
|
15
|
+
def self.perform
|
16
|
+
end
|
14
17
|
end
|
15
18
|
|
16
|
-
class
|
17
|
-
|
19
|
+
class BrokenTestJob
|
20
|
+
extend Appsignal::Integrations::ResquePlugin
|
18
21
|
|
19
|
-
|
22
|
+
def self.perform
|
23
|
+
raise VerySpecificError.new('broken')
|
24
|
+
end
|
20
25
|
end
|
21
|
-
end
|
22
|
-
|
23
|
-
load file
|
24
|
-
start_agent
|
25
|
-
end
|
26
26
|
|
27
|
-
describe :around_perform_resque_plugin do
|
28
|
-
let(:transaction) { Appsignal::Transaction.new(1, {}) }
|
29
|
-
let(:job) { Resque::Job }
|
30
|
-
let(:invoked_job) { nil }
|
31
|
-
before do
|
32
|
-
transaction.stub(:complete! => true)
|
33
|
-
Appsignal::Transaction.stub(:current => transaction)
|
34
27
|
end
|
35
28
|
|
36
|
-
|
37
|
-
|
38
|
-
|
29
|
+
describe :around_perform_resque_plugin do
|
30
|
+
let(:transaction) { Appsignal::Transaction.new(1, {}) }
|
31
|
+
let(:job) { Resque::Job.new('default', {'class' => 'TestJob'}) }
|
32
|
+
before do
|
33
|
+
transaction.stub(:complete! => true)
|
34
|
+
Appsignal::Transaction.stub(:current => transaction)
|
39
35
|
end
|
40
36
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
:method => 'perform'
|
46
|
-
)
|
47
|
-
end
|
37
|
+
context "without exception" do
|
38
|
+
it "should create a new transaction" do
|
39
|
+
Appsignal::Transaction.should_receive(:create).and_return(transaction)
|
40
|
+
end
|
48
41
|
|
49
|
-
|
50
|
-
|
51
|
-
|
42
|
+
it "should wrap in a transaction with the correct params" do
|
43
|
+
Appsignal.should_receive(:monitor_transaction).with(
|
44
|
+
'perform_job.resque',
|
45
|
+
:class => 'TestJob',
|
46
|
+
:method => 'perform'
|
47
|
+
)
|
48
|
+
end
|
52
49
|
|
53
|
-
|
54
|
-
|
50
|
+
it "should close the transaction" do
|
51
|
+
transaction.should_receive(:complete!)
|
52
|
+
end
|
55
53
|
|
56
|
-
|
57
|
-
it "should set the exception" do
|
58
|
-
transaction.should_receive(:add_exception)
|
54
|
+
after { job.perform }
|
59
55
|
end
|
60
56
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
57
|
+
context "with exception" do
|
58
|
+
let(:job) { Resque::Job.new('default', {'class' => 'BrokenTestJob'}) }
|
59
|
+
|
60
|
+
it "should set the exception" do
|
61
|
+
transaction.should_receive(:add_exception)
|
62
|
+
end
|
63
|
+
|
64
|
+
after do
|
65
|
+
begin
|
66
|
+
job.perform
|
67
|
+
rescue VerySpecificError
|
68
|
+
# Do nothing
|
69
|
+
end
|
66
70
|
end
|
67
71
|
end
|
68
72
|
end
|
69
73
|
end
|
70
|
-
end
|
71
74
|
|
72
|
-
|
73
|
-
|
75
|
+
context "without resque" do
|
76
|
+
before(:all) { Object.send(:remove_const, :Resque) }
|
74
77
|
|
75
|
-
|
76
|
-
|
78
|
+
specify { expect { ::Resque }.to raise_error(NameError) }
|
79
|
+
specify { expect { load file }.to_not raise_error }
|
80
|
+
end
|
77
81
|
end
|
78
82
|
end
|
data/spec/spec_helper.rb
CHANGED
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: 0.11.
|
4
|
+
version: 0.11.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2016-01-11 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rack
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- gemfiles/rails-4.0.gemfile
|
142
142
|
- gemfiles/rails-4.1.gemfile
|
143
143
|
- gemfiles/rails-4.2.gemfile
|
144
|
+
- gemfiles/resque.gemfile
|
144
145
|
- gemfiles/sequel.gemfile
|
145
146
|
- gemfiles/sinatra.gemfile
|
146
147
|
- lib/appsignal.rb
|