appsignal 0.12.beta.32 → 0.12.beta.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/appsignal_extension.c +3 -10
- data/lib/appsignal.rb +11 -8
- data/lib/appsignal/integrations/celluloid.rb +1 -1
- data/lib/appsignal/version.rb +2 -2
- data/spec/lib/appsignal/integrations/celluloid_spec.rb +2 -2
- data/spec/lib/appsignal_spec.rb +21 -21
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e66eec14b175b0b6948bc0156c75f0a487509f8a
|
4
|
+
data.tar.gz: 6ff24a317d2a7fbfcf3839b6f86bd86b03f5d351
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fd9d8738134d349e4cd0278d871f1ac25041446c6e045a642c4f11f8b837b47d0016f04592c5d1f5bb08fac4d60a5b065da8b9feb8576b8c531715f25639de1
|
7
|
+
data.tar.gz: 80335bfef01c3aae87f4ff4666908cf07521ec52516c5bb5f59150e6105e0d673d3c59593bd34b4db895b2a3b3e7f070e8f43307c7ba98edfcca12d765d10019
|
data/ext/appsignal_extension.c
CHANGED
@@ -7,14 +7,8 @@ static VALUE start(VALUE self) {
|
|
7
7
|
return Qnil;
|
8
8
|
}
|
9
9
|
|
10
|
-
static VALUE
|
11
|
-
|
12
|
-
|
13
|
-
return Qnil;
|
14
|
-
}
|
15
|
-
|
16
|
-
static VALUE stop_extension(VALUE self) {
|
17
|
-
appsignal_stop_extension();
|
10
|
+
static VALUE stop(VALUE self) {
|
11
|
+
appsignal_stop();
|
18
12
|
|
19
13
|
return Qnil;
|
20
14
|
}
|
@@ -222,8 +216,7 @@ void Init_appsignal_extension(void) {
|
|
222
216
|
|
223
217
|
// Transaction monitoring
|
224
218
|
rb_define_singleton_method(Extension, "start", start, 0);
|
225
|
-
rb_define_singleton_method(Extension, "
|
226
|
-
rb_define_singleton_method(Extension, "stop_extension", stop_extension, 0);
|
219
|
+
rb_define_singleton_method(Extension, "stop", stop, 0);
|
227
220
|
rb_define_singleton_method(Extension, "start_transaction", start_transaction, 2);
|
228
221
|
rb_define_singleton_method(Extension, "start_event", start_event, 1);
|
229
222
|
rb_define_singleton_method(Extension, "finish_event", finish_event, 4);
|
data/lib/appsignal.rb
CHANGED
@@ -37,7 +37,14 @@ module Appsignal
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def start
|
40
|
-
|
40
|
+
unless @config
|
41
|
+
@config = Config.new(
|
42
|
+
ENV['PWD'],
|
43
|
+
ENV['APPSIGNAL_APP_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV']
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
if config.valid?
|
41
48
|
if config[:debug]
|
42
49
|
logger.level = Logger::DEBUG
|
43
50
|
else
|
@@ -56,16 +63,12 @@ module Appsignal
|
|
56
63
|
logger.info("Not starting, not active for #{config.env}")
|
57
64
|
end
|
58
65
|
else
|
59
|
-
logger.error('
|
66
|
+
logger.error('Not starting, no valid config for this environment')
|
60
67
|
end
|
61
68
|
end
|
62
69
|
|
63
|
-
def
|
64
|
-
Appsignal::Extension.
|
65
|
-
end
|
66
|
-
|
67
|
-
def stop_extension
|
68
|
-
Appsignal::Extension.stop_extension
|
70
|
+
def stop
|
71
|
+
Appsignal::Extension.stop
|
69
72
|
end
|
70
73
|
|
71
74
|
def monitor_transaction(name, env={})
|
data/lib/appsignal/version.rb
CHANGED
@@ -15,9 +15,9 @@ describe "Celluloid integration" do
|
|
15
15
|
load file
|
16
16
|
end
|
17
17
|
|
18
|
-
specify { expect(Appsignal).to receive(:
|
19
|
-
|
18
|
+
specify { expect(Appsignal).to receive(:stop) }
|
20
19
|
specify { expect(Celluloid).to receive(:shutdown_without_appsignal) }
|
20
|
+
|
21
21
|
after do
|
22
22
|
Celluloid.shutdown
|
23
23
|
end
|
data/spec/lib/appsignal_spec.rb
CHANGED
@@ -32,12 +32,23 @@ describe Appsignal do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
describe ".start" do
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
context "with no config set beforehand" do
|
36
|
+
it "should do nothing when config is not set and there is no valid config in the env" do
|
37
|
+
Appsignal.logger.should_receive(:error).with(
|
38
|
+
"Push api key not set after loading config"
|
39
|
+
).once
|
40
|
+
Appsignal.logger.should_receive(:error).with(
|
41
|
+
"Not starting, no valid config for this environment"
|
42
|
+
).once
|
43
|
+
Appsignal::Extension.should_not_receive(:start)
|
44
|
+
Appsignal.start
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should create a config from the env" do
|
48
|
+
ENV['APPSIGNAL_PUSH_API_KEY'] = 'something'
|
49
|
+
Appsignal::Extension.should_receive(:start)
|
50
|
+
Appsignal.start
|
51
|
+
end
|
41
52
|
end
|
42
53
|
|
43
54
|
context "when config is loaded" do
|
@@ -77,9 +88,6 @@ describe Appsignal do
|
|
77
88
|
before { Appsignal.config = project_fixture_config('staging') }
|
78
89
|
|
79
90
|
it "should do nothing" do
|
80
|
-
Appsignal.logger.should_receive(:info).with(
|
81
|
-
'Not starting, not active for staging'
|
82
|
-
)
|
83
91
|
Appsignal.start
|
84
92
|
Appsignal.agent.should be_nil
|
85
93
|
end
|
@@ -135,18 +143,10 @@ describe Appsignal do
|
|
135
143
|
end
|
136
144
|
end
|
137
145
|
|
138
|
-
describe ".
|
139
|
-
it "should call
|
140
|
-
Appsignal::Extension.should_receive(:
|
141
|
-
Appsignal.
|
142
|
-
Appsignal.active?.should be_false
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
describe ".stop_extension" do
|
147
|
-
it "should call stop_extension on the extension" do
|
148
|
-
Appsignal::Extension.should_receive(:stop_extension)
|
149
|
-
Appsignal.stop_extension
|
146
|
+
describe ".stop" do
|
147
|
+
it "should call stop on the extension" do
|
148
|
+
Appsignal::Extension.should_receive(:stop)
|
149
|
+
Appsignal.stop
|
150
150
|
Appsignal.active?.should be_false
|
151
151
|
end
|
152
152
|
end
|
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.12.beta.
|
4
|
+
version: 0.12.beta.33
|
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: 2015-09-
|
15
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rack
|