chef-handler-librato 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/chef-handler-librato.gemspec +1 -1
- data/lib/chef/chef_handler_librato.rb +5 -6
- metadata +2 -2
@@ -42,12 +42,12 @@ class LibratoReporting < Chef::Handler
|
|
42
42
|
|
43
43
|
Chef::Log.debug("#{gemspec.full_name} loaded as a handler.")
|
44
44
|
|
45
|
-
|
45
|
+
Librato::Metrics.authenticate "#{@email}", "#{@api_key}"
|
46
46
|
|
47
47
|
metrics = Hash.new
|
48
48
|
metrics[:updated_resources] = run_status.updated_resources.length
|
49
49
|
metrics[:all_resources] = run_status.all_resources.length
|
50
|
-
metrics[:elapsed_time] = run_status.elapsed_time
|
50
|
+
metrics[:elapsed_time] = run_status.elapsed_time.to_i
|
51
51
|
|
52
52
|
if run_status.success?
|
53
53
|
metrics[:success] = 1
|
@@ -57,11 +57,10 @@ class LibratoReporting < Chef::Handler
|
|
57
57
|
metrics[:fail] = 1
|
58
58
|
end
|
59
59
|
|
60
|
-
|
60
|
+
|
61
61
|
metrics.each do |metric, value|
|
62
|
-
Chef::Log.debug("#{metric} #{value} #{
|
63
|
-
|
62
|
+
Chef::Log.debug("#{metric} #{value} #{Time.now}")
|
63
|
+
Librato::Metrics.submit :"#{metric}" => {:type => :"#{@metric_type}", :value => "#{value}", :source => "#{@source}" }
|
64
64
|
end
|
65
|
-
end
|
66
65
|
end
|
67
66
|
end
|