appsignal 1.2.1 → 1.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b40b132199c6068e639dd806e587066b942e4e24
4
- data.tar.gz: 3a0fe572f3d6d32ac2c88862fb2bc5ea98661cd3
3
+ metadata.gz: 4d5f6164fcbb45bfc381a58c68140a97c1c94393
4
+ data.tar.gz: f88bea811683f981f8e88d1cf7de344917a34499
5
5
  SHA512:
6
- metadata.gz: ea977bb6a35a3f94e3bdd46018af4f81c7801c804c2cf485371b7216afa8bf7c2ed4f2444503ac393ceeb2ca34cd7f4e37b90fe75c949b37f67696adfe372c6c
7
- data.tar.gz: b3d4df756299586f67e77899569c6951167ff72aeb3ec2783ac4461f046bf571e7a98fc0f6bc125da85d054900dc53b527d7f4da5d5f3609f38614b463043b7c
6
+ metadata.gz: 7b51229db4c5a815eaea0459078d4bcc3b99b252de412b74d1d7e020ce0bc27f64cf0a10154acf1175cc1cda0aec2af2223f9790d2eca45a2334fa5a396a8d96
7
+ data.tar.gz: 477227b0dd58d3276d1ec5b1fb56a9b0f0499fc1e9fccbc20cfab7b9172ce6c90fd02695fd3743a7f332bec6b3a1b07669d34c0382da1d1f432af8e4f8d36fca
@@ -1,3 +1,6 @@
1
+ # 1.2.2
2
+ * Handle out of range numbers in queue lenght and metrics api
3
+
1
4
  # 1.2.1
2
5
  * Use Dir.pwd in CLI install wizard
3
6
  * Support bignums when setting queue length
@@ -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
@@ -117,6 +117,8 @@ module Appsignal
117
117
  def set_queue_start(start)
118
118
  return unless start
119
119
  @ext.set_queue_start(start)
120
+ rescue RangeError
121
+ Appsignal.logger.warn("Queue start value #{start} is too big")
120
122
  end
121
123
 
122
124
  def set_http_or_background_queue_start
@@ -1,5 +1,5 @@
1
1
  require 'yaml'
2
2
 
3
3
  module Appsignal
4
- VERSION = '1.2.1'
4
+ VERSION = '1.2.2'
5
5
  end
@@ -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
@@ -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.1
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-29 00:00:00.000000000 Z
12
+ date: 2016-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack