appsignal 0.6.5 → 0.6.6
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 +8 -8
- data/CHANGELOG.md +3 -0
- data/LICENSE +1 -1
- data/appsignal.gemspec +1 -0
- data/lib/appsignal.rb +10 -7
- data/lib/appsignal/transaction/transaction_formatter.rb +0 -1
- data/lib/appsignal/version.rb +1 -1
- data/spec/appsignal_spec.rb +44 -4
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGQ3NjM0YzRiNjRhZmI0NTY1YmE3OThmZmJkMDE2YzljNDRmZjc4YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGM3MmU0NGZlMDk4OTAyNGFkNGMxYTMwN2Y3ZTQyMTMzMmZkNWZkZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjRmNTY5YThmNzRlZGRjNWM3ZTA1MmFhMzE5NTEzZWRjOWY2ZDk0ZWYyMjlm
|
10
|
+
MWFlNDkxMzIzYmI5ZTI2MzVhNjE4Njk4OWJmYmRjMWUwZWQ2ODZmYjk3Y2Rh
|
11
|
+
NjE5NjdhMWY1ZjAzMWQ5NjJiYzFmYjFiMzYyYWQ0YWMyNmViNGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWM4NGIzOGVmMDlkZjBjYzgwNGZkYjEyMjU3YWZmNDM0YWRmNzU4OTJmNjYy
|
14
|
+
YWJmYWY4MDY0Zjc5ZjI3OTE0MjMwNzNkMGQ0MjhjY2U4MmJlODUxZTMwZmI5
|
15
|
+
MzhhNWVkNmQwZmVlYzFiMjAxMWM4YzJkMzVmNGZmNWE0YjkzNGY=
|
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
data/appsignal.gemspec
CHANGED
@@ -14,6 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.summary = 'Logs performance and exception data from your app to'\
|
15
15
|
'appsignal.com'
|
16
16
|
gem.homepage = 'http://github.com/appsignal/appsignal'
|
17
|
+
gem.license = 'MIT'
|
17
18
|
|
18
19
|
gem.files = `git ls-files`.split($\)
|
19
20
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
data/lib/appsignal.rb
CHANGED
@@ -27,14 +27,17 @@ module Appsignal
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def send_exception(exception)
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
return if is_ignored_exception?(exception)
|
31
|
+
transaction = Appsignal::Transaction.create(SecureRandom.uuid, ENV.to_hash)
|
32
|
+
transaction.add_exception(exception)
|
33
|
+
transaction.complete!
|
34
|
+
Appsignal.agent.send_queue
|
35
|
+
end
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
Appsignal.
|
37
|
+
def add_exception(exception)
|
38
|
+
return if Appsignal::Transaction.current.nil? || exception.nil?
|
39
|
+
unless is_ignored_exception?(exception)
|
40
|
+
Appsignal::Transaction.current.add_exception(exception)
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
data/lib/appsignal/version.rb
CHANGED
data/spec/appsignal_spec.rb
CHANGED
@@ -2,9 +2,9 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Appsignal do
|
4
4
|
it { should respond_to :subscriber }
|
5
|
+
let(:transaction) { regular_transaction }
|
5
6
|
|
6
7
|
describe ".enqueue" do
|
7
|
-
let(:transaction) { regular_transaction }
|
8
8
|
subject { Appsignal.enqueue(transaction) }
|
9
9
|
|
10
10
|
it "forwards the call to the agent" do
|
@@ -126,14 +126,21 @@ describe Appsignal do
|
|
126
126
|
end
|
127
127
|
|
128
128
|
describe ".send_exception" do
|
129
|
-
it "should
|
129
|
+
it "should send the exception to AppSignal" do
|
130
130
|
agent = double
|
131
|
-
Appsignal.
|
131
|
+
Appsignal.stub(:agent).and_return(agent)
|
132
132
|
agent.should_receive(:send_queue)
|
133
133
|
agent.should_receive(:enqueue).with(kind_of(Appsignal::Transaction))
|
134
134
|
|
135
135
|
Appsignal::Transaction.should_receive(:create).and_call_original
|
136
|
+
end
|
137
|
+
|
138
|
+
it "should not send the exception if it's in the ignored list" do
|
139
|
+
Appsignal.stub(:is_ignored_exception? => true)
|
140
|
+
Appsignal::Transaction.should_not_receive(:create)
|
141
|
+
end
|
136
142
|
|
143
|
+
after do
|
137
144
|
begin
|
138
145
|
raise "I am an exception"
|
139
146
|
rescue Exception => e
|
@@ -143,7 +150,7 @@ describe Appsignal do
|
|
143
150
|
end
|
144
151
|
|
145
152
|
describe ".listen_for_exception" do
|
146
|
-
it "should raise
|
153
|
+
it "should call send_exception and re-raise" do
|
147
154
|
Appsignal.should_receive(:send_exception).with(kind_of(Exception))
|
148
155
|
lambda {
|
149
156
|
Appsignal.listen_for_exception do
|
@@ -152,4 +159,37 @@ describe Appsignal do
|
|
152
159
|
}.should raise_error(RuntimeError, "I am an exception")
|
153
160
|
end
|
154
161
|
end
|
162
|
+
|
163
|
+
describe ".add_exception" do
|
164
|
+
before { Appsignal::Transaction.stub(:current => transaction) }
|
165
|
+
let(:exception) { RuntimeError.new('I am an exception') }
|
166
|
+
|
167
|
+
it "should add the exception to the current transaction" do
|
168
|
+
transaction.should_receive(:add_exception).with(exception)
|
169
|
+
|
170
|
+
Appsignal.add_exception(exception)
|
171
|
+
end
|
172
|
+
|
173
|
+
it "should do nothing if there is no current transaction" do
|
174
|
+
Appsignal::Transaction.stub(:current => nil)
|
175
|
+
|
176
|
+
transaction.should_not_receive(:add_exception).with(exception)
|
177
|
+
|
178
|
+
Appsignal.add_exception(exception)
|
179
|
+
end
|
180
|
+
|
181
|
+
it "should not add the exception if it's in the ignored list" do
|
182
|
+
Appsignal.stub(:is_ignored_exception? => true)
|
183
|
+
|
184
|
+
transaction.should_not_receive(:add_exception).with(exception)
|
185
|
+
|
186
|
+
Appsignal.add_exception(exception)
|
187
|
+
end
|
188
|
+
|
189
|
+
it "should do nothing if the exception is nil" do
|
190
|
+
transaction.should_not_receive(:add_exception)
|
191
|
+
|
192
|
+
Appsignal.add_exception(nil)
|
193
|
+
end
|
194
|
+
end
|
155
195
|
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.6.
|
4
|
+
version: 0.6.6
|
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: 2013-
|
15
|
+
date: 2013-10-02 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|
@@ -192,7 +192,8 @@ files:
|
|
192
192
|
- spec/support/helpers/notification_helpers.rb
|
193
193
|
- spec/support/helpers/transaction_helpers.rb
|
194
194
|
homepage: http://github.com/appsignal/appsignal
|
195
|
-
licenses:
|
195
|
+
licenses:
|
196
|
+
- MIT
|
196
197
|
metadata: {}
|
197
198
|
post_install_message:
|
198
199
|
rdoc_options: []
|