appsignal 0.12.rc.7 → 0.12.rc.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/agent.yml +7 -7
- data/lib/appsignal.rb +3 -15
- data/lib/appsignal/hooks.rb +61 -0
- data/lib/appsignal/hooks/celluloid.rb +29 -0
- data/lib/appsignal/hooks/delayed_job.rb +18 -0
- data/lib/appsignal/hooks/net_http.rb +31 -0
- data/lib/appsignal/hooks/passenger.rb +21 -0
- data/lib/appsignal/hooks/puma.rb +20 -0
- data/lib/appsignal/hooks/rake.rb +42 -0
- data/lib/appsignal/hooks/redis.rb +24 -0
- data/lib/appsignal/hooks/resque.rb +28 -0
- data/lib/appsignal/hooks/sequel.rb +38 -0
- data/lib/appsignal/hooks/sidekiq.rb +68 -0
- data/lib/appsignal/hooks/unicorn.rb +39 -0
- data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +27 -29
- data/lib/appsignal/integrations/delayed_job_plugin.rb +39 -0
- data/lib/appsignal/integrations/railtie.rb +41 -0
- data/lib/appsignal/transaction.rb +9 -4
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/{integrations/capistrano2_spec.rb → capistrano2_spec.rb} +1 -1
- data/spec/lib/appsignal/{integrations/capistrano3_spec.rb → capistrano3_spec.rb} +0 -0
- data/spec/lib/appsignal/{integrations → hooks}/celluloid_spec.rb +8 -11
- data/spec/lib/appsignal/{integrations → hooks}/delayed_job_spec.rb +7 -10
- data/spec/lib/appsignal/hooks/net_http_spec.rb +55 -0
- data/spec/lib/appsignal/hooks/passenger_spec.rb +24 -0
- data/spec/lib/appsignal/hooks/puma_spec.rb +50 -0
- data/spec/lib/appsignal/{integrations → hooks}/rake_spec.rb +4 -3
- data/spec/lib/appsignal/hooks/redis_spec.rb +59 -0
- data/spec/lib/appsignal/{integrations → hooks}/resque_spec.rb +5 -11
- data/spec/lib/appsignal/{instrumentations → hooks}/sequel_spec.rb +1 -3
- data/spec/lib/appsignal/{integrations → hooks}/sidekiq_spec.rb +20 -20
- data/spec/lib/appsignal/hooks/unicorn_spec.rb +46 -0
- data/spec/lib/appsignal/hooks_spec.rb +76 -0
- data/spec/lib/appsignal/integrations/{rails_spec.rb → railtie_spec.rb} +0 -0
- data/spec/lib/appsignal/transaction_spec.rb +3 -3
- data/spec/lib/appsignal_spec.rb +0 -33
- metadata +46 -42
- data/lib/appsignal/instrumentations/net_http.rb +0 -17
- data/lib/appsignal/instrumentations/redis.rb +0 -13
- data/lib/appsignal/instrumentations/sequel.rb +0 -31
- data/lib/appsignal/integrations/celluloid.rb +0 -19
- data/lib/appsignal/integrations/delayed_job.rb +0 -44
- data/lib/appsignal/integrations/passenger.rb +0 -11
- data/lib/appsignal/integrations/puma.rb +0 -10
- data/lib/appsignal/integrations/rails.rb +0 -43
- data/lib/appsignal/integrations/rake.rb +0 -30
- data/lib/appsignal/integrations/resque.rb +0 -22
- data/lib/appsignal/integrations/sidekiq.rb +0 -62
- data/lib/appsignal/integrations/unicorn.rb +0 -28
- data/spec/lib/appsignal/instrumentations/net_http_spec.rb +0 -40
- data/spec/lib/appsignal/instrumentations/redis_spec.rb +0 -45
- data/spec/lib/appsignal/integrations/passenger_spec.rb +0 -22
- data/spec/lib/appsignal/integrations/puma_spec.rb +0 -52
- data/spec/lib/appsignal/integrations/unicorn_spec.rb +0 -48
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Puma integration" do
|
4
|
-
let(:file) { File.expand_path('lib/appsignal/integrations/puma.rb') }
|
5
|
-
before(:all) do
|
6
|
-
class Puma
|
7
|
-
def self.cli_config
|
8
|
-
@cli_config ||= CliConfig.new
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
class CliConfig
|
13
|
-
attr_accessor :options
|
14
|
-
|
15
|
-
def initialize
|
16
|
-
@options = {}
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
before do
|
21
|
-
start_agent
|
22
|
-
end
|
23
|
-
|
24
|
-
context "with a nil before worker shutdown" do
|
25
|
-
before do
|
26
|
-
Puma.cli_config.options.delete(:before_worker_shutdown)
|
27
|
-
load file
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should add a before shutdown worker callback" do
|
31
|
-
Puma.cli_config.options[:before_worker_shutdown].first.should be_a(Proc)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context "with an existing before worker shutdown" do
|
36
|
-
before do
|
37
|
-
Puma.cli_config.options[:before_worker_shutdown] = []
|
38
|
-
load file
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should add a before shutdown worker callback" do
|
42
|
-
Puma.cli_config.options[:before_worker_shutdown].first.should be_a(Proc)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
context "without Puma" do
|
47
|
-
before(:all) { Object.send(:remove_const, :Puma) }
|
48
|
-
|
49
|
-
specify { expect { Puma }.to raise_error(NameError) }
|
50
|
-
specify { expect { load file }.to_not raise_error }
|
51
|
-
end
|
52
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Unicorn integration" do
|
4
|
-
let(:file) { File.expand_path('lib/appsignal/integrations/unicorn.rb') }
|
5
|
-
before(:all) do
|
6
|
-
module Unicorn
|
7
|
-
class HttpServer
|
8
|
-
def worker_loop(worker)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
class Worker
|
13
|
-
def close
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
before do
|
19
|
-
load file
|
20
|
-
start_agent
|
21
|
-
end
|
22
|
-
|
23
|
-
it "adds behavior to Unicorn::HttpServer#worker_loop" do
|
24
|
-
server = Unicorn::HttpServer.new
|
25
|
-
worker = double
|
26
|
-
|
27
|
-
Appsignal.should_receive(:forked)
|
28
|
-
server.should_receive(:original_worker_loop).with(worker)
|
29
|
-
|
30
|
-
server.worker_loop(worker)
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should add behavior to Unicorn::Worker#close" do
|
34
|
-
worker = Unicorn::Worker.new
|
35
|
-
|
36
|
-
Appsignal.should_receive(:stop)
|
37
|
-
worker.should_receive(:original_close)
|
38
|
-
|
39
|
-
worker.close
|
40
|
-
end
|
41
|
-
|
42
|
-
context "without unicorn" do
|
43
|
-
before(:all) { Object.send(:remove_const, :Unicorn) }
|
44
|
-
|
45
|
-
specify { expect { Unicorn }.to raise_error(NameError) }
|
46
|
-
specify { expect { load file }.to_not raise_error }
|
47
|
-
end
|
48
|
-
end
|