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.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "chef-handler-librato"
6
- s.version = "1.1.2"
6
+ s.version = "1.1.3"
7
7
  s.authors = ["Brian Scott"]
8
8
  s.email = ["brainscott@gmail.com"]
9
9
  s.homepage = ""
@@ -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
- @l = Librato::Metrics.authenticate "#{@email}", "#{@api_key}"
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
- metrics.length.each do |librato|
60
+
61
61
  metrics.each do |metric, value|
62
- Chef::Log.debug("#{metric} #{value} #{l.time_now}")
63
- @l.submit :"#{metric}" => {:type => :"#{@metric_type}", :value => "#{value}", :source => "#{@source}" }
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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 2
9
- version: 1.1.2
8
+ - 3
9
+ version: 1.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Brian Scott