cloudscopes 0.8.0 → 0.8.1
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 +4 -4
- data/lib/cloudscopes/configuration.rb +1 -1
- data/lib/cloudscopes/globals.rb +2 -2
- data/lib/cloudscopes/sample.rb +2 -2
- data/lib/cloudscopes/version.rb +1 -1
- data/lib/cloudscopes.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29c742176d650ed007a12245e8df02ec9736b894
|
|
4
|
+
data.tar.gz: effeb7e2a0dae22ac33ff243f34d19e3a2139169
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1df637739da6f4ec6ec280e8d2a0408fcc836bc65bfa1b0f26a2d186d53a3dc32ee02b65fa41f91812502f32737672ec9f560dc58115cf42a62cd7f550f1a834
|
|
7
|
+
data.tar.gz: 57a9859f94aa5c1244c0debcf3ac99350f8f9876e08be303191fc9333c6941cbd52cc7f0ccac17ee3067f4a05eabef3995bac72a22a204c32c3d695a1f8a4579
|
|
@@ -3,7 +3,7 @@ module Cloudscopes
|
|
|
3
3
|
attr_reader :should_publish, :usage_requested
|
|
4
4
|
|
|
5
5
|
def self.init
|
|
6
|
-
@opts =
|
|
6
|
+
@opts = Cloudscopes::Options.new
|
|
7
7
|
usage if usage_requested
|
|
8
8
|
configuration = {}
|
|
9
9
|
(@opts.files.empty?? [ STDIN ] : @opts.files.collect { |fn| File.new(fn) }).each do |configfile|
|
data/lib/cloudscopes/globals.rb
CHANGED
|
@@ -9,7 +9,7 @@ def publish(samples)
|
|
|
9
9
|
valid_data = metric_samples.select(&:valid)
|
|
10
10
|
next if valid_data.empty?
|
|
11
11
|
valid_data.each_slice(4) do |slice| # slice metrics to chunks - the actual limit is 20, but CloudWatch starts misbehaving if I put too much data
|
|
12
|
-
|
|
12
|
+
Cloudscopes.client.put_metric_data namespace: type,
|
|
13
13
|
metric_data: slice.collect(&:to_cloudwatch_metric_data)
|
|
14
14
|
end
|
|
15
15
|
rescue Exception => e
|
|
@@ -21,5 +21,5 @@ end
|
|
|
21
21
|
def sample(category, *metrics)
|
|
22
22
|
category, metrics = category if category.is_a? Array # sample may be passed the single yield variable of Hash#each
|
|
23
23
|
metrics = [ metrics ] unless metrics.is_a? Array
|
|
24
|
-
[ category, metrics.collect { |m|
|
|
24
|
+
[ category, metrics.collect { |m| Cloudscopes::Sample.new(category, m) } ]
|
|
25
25
|
end
|
data/lib/cloudscopes/sample.rb
CHANGED
|
@@ -13,8 +13,8 @@ module Cloudscopes
|
|
|
13
13
|
@value = nil
|
|
14
14
|
|
|
15
15
|
begin
|
|
16
|
-
return if metric['requires'] and !
|
|
17
|
-
@value =
|
|
16
|
+
return if metric['requires'] and ! Cloudscopes.get_binding.eval(metric['requires'])
|
|
17
|
+
@value = Cloudscopes.get_binding.eval(metric['value'])
|
|
18
18
|
rescue => e
|
|
19
19
|
STDERR.puts("Error evaluating #{@name}: #{e}")
|
|
20
20
|
puts e.backtrace
|
data/lib/cloudscopes/version.rb
CHANGED
data/lib/cloudscopes.rb
CHANGED