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 +4 -4
- data/lib/appsignal.rb +4 -4
- data/lib/appsignal/config.rb +6 -0
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/config_spec.rb +8 -0
- data/spec/lib/appsignal_spec.rb +24 -4
- 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: 8abee3c3d71ca75aaa7a6f2a4ff11c7048329883
|
4
|
+
data.tar.gz: d2b8b6c04bfe5c10e350b0693cc467c7f02ab7c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/appsignal/config.rb
CHANGED
@@ -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
|
data/lib/appsignal/version.rb
CHANGED
@@ -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'
|
data/spec/lib/appsignal_spec.rb
CHANGED
@@ -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
|
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.
|
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-
|
12
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|