appsignal 0.12.beta.46 → 0.12.beta.47

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66fd4a1ffd41f53418940bd58995fe9d0a67a7e0
4
- data.tar.gz: 299446a2ccd7b9bc4ba194db6da7092237cc0303
3
+ metadata.gz: 8abee3c3d71ca75aaa7a6f2a4ff11c7048329883
4
+ data.tar.gz: d2b8b6c04bfe5c10e350b0693cc467c7f02ab7c1
5
5
  SHA512:
6
- metadata.gz: 93316d994e6bf831e264f950d13ddba4cf27baedd8fc91ad18a676f0567f47080f865773d9811f4896c36519b3bcd5b246628ffd609d10a362895c1c0d6715f7
7
- data.tar.gz: ff4fe3778ae5c7c3c0cade05e598a5f44c37d44366cc5205f231c410dd4ae10d6b2aaf0fdc3c60da71bbf3232e135b65e7c1c621ecd1e837a987ccdab6951a60
6
+ metadata.gz: d2318f555f6410570f8fcad5429df6701e105d58c99ee535fb94d09c08b0e42ad1635fa92db3da1297c638040239adf522d45ad7c890a60ff842368191667e33
7
+ data.tar.gz: 3f025a757774b7402d15861bbf2eb4df2f8da6c7fc3bf230e1a4840c25f8d0acf297f0ceeb1126bb200238bcd637e2b876e455f47185c0590da314ea9dc163d2
data/lib/appsignal.rb CHANGED
@@ -167,15 +167,15 @@ module Appsignal
167
167
  alias :tag_job :tag_request
168
168
 
169
169
  def set_gauge(key, value)
170
- Appsignal::Extension.set_gauge(key, value)
170
+ Appsignal::Extension.set_gauge(key, value.to_f)
171
171
  end
172
172
 
173
173
  def set_host_gauge(key, value)
174
- Appsignal::Extension.set_host_gauge(key, value)
174
+ Appsignal::Extension.set_host_gauge(key, value.to_f)
175
175
  end
176
176
 
177
177
  def set_process_gauge(key, value)
178
- Appsignal::Extension.set_process_gauge(key, value)
178
+ Appsignal::Extension.set_process_gauge(key, value.to_f)
179
179
  end
180
180
 
181
181
  def increment_counter(key, value)
@@ -183,7 +183,7 @@ module Appsignal
183
183
  end
184
184
 
185
185
  def add_distribution_value(key, value)
186
- Appsignal::Extension.add_distribution_value(key, value)
186
+ Appsignal::Extension.add_distribution_value(key, value.to_f)
187
187
  end
188
188
 
189
189
  def logger
@@ -1,5 +1,6 @@
1
1
  require 'erb'
2
2
  require 'yaml'
3
+ require 'uri'
3
4
  require 'appsignal/integrations/capistrano/careful_logger'
4
5
 
5
6
  module Appsignal
@@ -161,6 +162,11 @@ module Appsignal
161
162
  end
162
163
 
163
164
  def validate
165
+ # Strip path from endpoint so we're backwards compatible with
166
+ # earlier versions of the gem.
167
+ endpoint_uri = URI(config_hash[:endpoint])
168
+ config_hash[:endpoint] = "#{endpoint_uri.scheme}://#{endpoint_uri.host}"
169
+
164
170
  if config_hash[:push_api_key]
165
171
  @valid = true
166
172
  else
@@ -1,5 +1,5 @@
1
1
  require 'yaml'
2
2
 
3
3
  module Appsignal
4
- VERSION = '0.12.beta.46'
4
+ VERSION = '0.12.beta.47'
5
5
  end
@@ -33,6 +33,14 @@ describe Appsignal::Config do
33
33
  }
34
34
  end
35
35
 
36
+ context "when there is a pre 0.12 style endpoint" do
37
+ let(:config) { project_fixture_config('production', :endpoint => 'https://push.appsignal.com/1') }
38
+
39
+ it "should strip the path" do
40
+ subject[:endpoint].should == 'https://push.appsignal.com'
41
+ end
42
+ end
43
+
36
44
  describe "#[]" do
37
45
  it "should get the value for an existing key" do
38
46
  subject[:push_api_key].should == 'abc'
@@ -381,24 +381,39 @@ describe Appsignal do
381
381
 
382
382
  describe "custom stats" do
383
383
  describe ".set_gauge" do
384
- it "should call set_gauge on the extension" do
384
+ it "should call set_gauge on the extension with a float" do
385
385
  Appsignal::Extension.should_receive(:set_gauge).with('key', 0.1)
386
386
  Appsignal.set_gauge('key', 0.1)
387
387
  end
388
+
389
+ it "should call set_gauge on the extension with an int" do
390
+ Appsignal::Extension.should_receive(:set_gauge).with('key', 1.0)
391
+ Appsignal.set_gauge('key', 1)
392
+ end
388
393
  end
389
394
 
390
395
  describe ".set_host_gauge" do
391
- it "should call set_host_gauge on the extension" do
396
+ it "should call set_host_gauge on the extension with a float" do
392
397
  Appsignal::Extension.should_receive(:set_host_gauge).with('key', 0.1)
393
398
  Appsignal.set_host_gauge('key', 0.1)
394
399
  end
400
+
401
+ it "should call set_host_gauge on the extension with an int" do
402
+ Appsignal::Extension.should_receive(:set_host_gauge).with('key', 1.0)
403
+ Appsignal.set_host_gauge('key', 1)
404
+ end
395
405
  end
396
406
 
397
407
  describe ".set_process_gauge" do
398
- it "should call set_process_gauge on the extension" do
408
+ it "should call set_process_gauge on the extension with a float" do
399
409
  Appsignal::Extension.should_receive(:set_process_gauge).with('key', 0.1)
400
410
  Appsignal.set_process_gauge('key', 0.1)
401
411
  end
412
+
413
+ it "should call set_process_gauge on the extension with an int" do
414
+ Appsignal::Extension.should_receive(:set_process_gauge).with('key', 1.0)
415
+ Appsignal.set_process_gauge('key', 1)
416
+ end
402
417
  end
403
418
 
404
419
  describe ".increment_counter" do
@@ -409,10 +424,15 @@ describe Appsignal do
409
424
  end
410
425
 
411
426
  describe ".add_distribution_value" do
412
- it "should call increment_counter on the extension" do
427
+ it "should call add_distribution_value on the extension with a float" do
413
428
  Appsignal::Extension.should_receive(:add_distribution_value).with('key', 0.1)
414
429
  Appsignal.add_distribution_value('key', 0.1)
415
430
  end
431
+
432
+ it "should call add_distribution_value on the extension with an int" do
433
+ Appsignal::Extension.should_receive(:add_distribution_value).with('key', 1.0)
434
+ Appsignal.add_distribution_value('key', 1)
435
+ end
416
436
  end
417
437
  end
418
438
 
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.46
4
+ version: 0.12.beta.47
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: 2015-10-16 00:00:00.000000000 Z
12
+ date: 2015-10-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack