appsignal 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/appsignal.rb +10 -0
- data/lib/appsignal/transaction.rb +2 -0
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/transaction_spec.rb +10 -0
- data/spec/lib/appsignal_spec.rb +40 -0
- 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: 4d5f6164fcbb45bfc381a58c68140a97c1c94393
|
4
|
+
data.tar.gz: f88bea811683f981f8e88d1cf7de344917a34499
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b51229db4c5a815eaea0459078d4bcc3b99b252de412b74d1d7e020ce0bc27f64cf0a10154acf1175cc1cda0aec2af2223f9790d2eca45a2334fa5a396a8d96
|
7
|
+
data.tar.gz: 477227b0dd58d3276d1ec5b1fb56a9b0f0499fc1e9fccbc20cfab7b9172ce6c90fd02695fd3743a7f332bec6b3a1b07669d34c0382da1d1f432af8e4f8d36fca
|
data/CHANGELOG.md
CHANGED
data/lib/appsignal.rb
CHANGED
@@ -179,22 +179,32 @@ module Appsignal
|
|
179
179
|
|
180
180
|
def set_gauge(key, value)
|
181
181
|
Appsignal::Extension.set_gauge(key, value.to_f)
|
182
|
+
rescue RangeError
|
183
|
+
Appsignal.logger.warn("Gauge value #{value} for key '#{key}' is too big")
|
182
184
|
end
|
183
185
|
|
184
186
|
def set_host_gauge(key, value)
|
185
187
|
Appsignal::Extension.set_host_gauge(key, value.to_f)
|
188
|
+
rescue RangeError
|
189
|
+
Appsignal.logger.warn("Host gauge value #{value} for key '#{key}' is too big")
|
186
190
|
end
|
187
191
|
|
188
192
|
def set_process_gauge(key, value)
|
189
193
|
Appsignal::Extension.set_process_gauge(key, value.to_f)
|
194
|
+
rescue RangeError
|
195
|
+
Appsignal.logger.warn("Process gauge value #{value} for key '#{key}' is too big")
|
190
196
|
end
|
191
197
|
|
192
198
|
def increment_counter(key, value=1)
|
193
199
|
Appsignal::Extension.increment_counter(key, value)
|
200
|
+
rescue RangeError
|
201
|
+
Appsignal.logger.warn("Counter value #{value} for key '#{key}' is too big")
|
194
202
|
end
|
195
203
|
|
196
204
|
def add_distribution_value(key, value)
|
197
205
|
Appsignal::Extension.add_distribution_value(key, value.to_f)
|
206
|
+
rescue RangeError
|
207
|
+
Appsignal.logger.warn("Distribution value #{value} for key '#{key}' is too big")
|
198
208
|
end
|
199
209
|
|
200
210
|
def logger
|
data/lib/appsignal/version.rb
CHANGED
@@ -269,6 +269,16 @@ describe Appsignal::Transaction do
|
|
269
269
|
|
270
270
|
transaction.set_queue_start(nil)
|
271
271
|
end
|
272
|
+
|
273
|
+
it "should not raise an error when the queue start is too big" do
|
274
|
+
transaction.ext.should_receive(:set_queue_start).and_raise(RangeError)
|
275
|
+
|
276
|
+
Appsignal.logger.should_receive(:warn).with("Queue start value 10 is too big")
|
277
|
+
|
278
|
+
lambda {
|
279
|
+
transaction.set_queue_start(10)
|
280
|
+
}.should_not raise_error
|
281
|
+
end
|
272
282
|
end
|
273
283
|
|
274
284
|
describe "#set_http_or_background_queue_start" do
|
data/spec/lib/appsignal_spec.rb
CHANGED
@@ -402,6 +402,14 @@ describe Appsignal do
|
|
402
402
|
Appsignal::Extension.should_receive(:set_gauge).with('key', 1.0)
|
403
403
|
Appsignal.set_gauge('key', 1)
|
404
404
|
end
|
405
|
+
|
406
|
+
it "should not raise an exception when out of range" do
|
407
|
+
Appsignal::Extension.should_receive(:set_gauge).with('key', 10).and_raise(RangeError)
|
408
|
+
Appsignal.logger.should_receive(:warn).with("Gauge value 10 for key 'key' is too big")
|
409
|
+
lambda {
|
410
|
+
Appsignal.set_gauge('key', 10)
|
411
|
+
}.should_not raise_error
|
412
|
+
end
|
405
413
|
end
|
406
414
|
|
407
415
|
describe ".set_host_gauge" do
|
@@ -414,6 +422,14 @@ describe Appsignal do
|
|
414
422
|
Appsignal::Extension.should_receive(:set_host_gauge).with('key', 1.0)
|
415
423
|
Appsignal.set_host_gauge('key', 1)
|
416
424
|
end
|
425
|
+
|
426
|
+
it "should not raise an exception when out of range" do
|
427
|
+
Appsignal::Extension.should_receive(:set_host_gauge).with('key', 10).and_raise(RangeError)
|
428
|
+
Appsignal.logger.should_receive(:warn).with("Host gauge value 10 for key 'key' is too big")
|
429
|
+
lambda {
|
430
|
+
Appsignal.set_host_gauge('key', 10)
|
431
|
+
}.should_not raise_error
|
432
|
+
end
|
417
433
|
end
|
418
434
|
|
419
435
|
describe ".set_process_gauge" do
|
@@ -426,6 +442,14 @@ describe Appsignal do
|
|
426
442
|
Appsignal::Extension.should_receive(:set_process_gauge).with('key', 1.0)
|
427
443
|
Appsignal.set_process_gauge('key', 1)
|
428
444
|
end
|
445
|
+
|
446
|
+
it "should not raise an exception when out of range" do
|
447
|
+
Appsignal::Extension.should_receive(:set_process_gauge).with('key', 10).and_raise(RangeError)
|
448
|
+
Appsignal.logger.should_receive(:warn).with("Process gauge value 10 for key 'key' is too big")
|
449
|
+
lambda {
|
450
|
+
Appsignal.set_process_gauge('key', 10)
|
451
|
+
}.should_not raise_error
|
452
|
+
end
|
429
453
|
end
|
430
454
|
|
431
455
|
describe ".increment_counter" do
|
@@ -438,6 +462,14 @@ describe Appsignal do
|
|
438
462
|
Appsignal::Extension.should_receive(:increment_counter).with('key', 5)
|
439
463
|
Appsignal.increment_counter('key', 5)
|
440
464
|
end
|
465
|
+
|
466
|
+
it "should not raise an exception when out of range" do
|
467
|
+
Appsignal::Extension.should_receive(:increment_counter).with('key', 10).and_raise(RangeError)
|
468
|
+
Appsignal.logger.should_receive(:warn).with("Counter value 10 for key 'key' is too big")
|
469
|
+
lambda {
|
470
|
+
Appsignal.increment_counter('key', 10)
|
471
|
+
}.should_not raise_error
|
472
|
+
end
|
441
473
|
end
|
442
474
|
|
443
475
|
describe ".add_distribution_value" do
|
@@ -450,6 +482,14 @@ describe Appsignal do
|
|
450
482
|
Appsignal::Extension.should_receive(:add_distribution_value).with('key', 1.0)
|
451
483
|
Appsignal.add_distribution_value('key', 1)
|
452
484
|
end
|
485
|
+
|
486
|
+
it "should not raise an exception when out of range" do
|
487
|
+
Appsignal::Extension.should_receive(:add_distribution_value).with('key', 10).and_raise(RangeError)
|
488
|
+
Appsignal.logger.should_receive(:warn).with("Distribution value 10 for key 'key' is too big")
|
489
|
+
lambda {
|
490
|
+
Appsignal.add_distribution_value('key', 10)
|
491
|
+
}.should_not raise_error
|
492
|
+
end
|
453
493
|
end
|
454
494
|
end
|
455
495
|
|
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: 1.2.
|
4
|
+
version: 1.2.2
|
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: 2016-06-
|
12
|
+
date: 2016-06-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|