chef-metrics 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/chef-metrics.gemspec CHANGED
@@ -10,5 +10,5 @@ Gem::Specification.new do |gem|
10
10
  gem.files = `git ls-files`.split($\)
11
11
  gem.name = "chef-metrics"
12
12
  gem.require_paths = ["lib"]
13
- gem.version = "0.0.1"
13
+ gem.version = "0.0.2"
14
14
  end
data/lib/chef-metrics.rb CHANGED
@@ -2,13 +2,13 @@ require "rubygems"
2
2
  require "chef/handler"
3
3
 
4
4
  class ChefMetrics < Chef::Handler
5
- attr_accessor :action, :metric_scheme, :measure_time, :metrics
5
+ attr_accessor :metric_scheme, :measure_time, :metrics, :action
6
6
 
7
7
  def initialize(&action)
8
- @action = action
9
- @metric_scheme = "chef"
8
+ @metric_scheme = "chef.#{Chef::Config.node_name}"
10
9
  @measure_time = Time.now.to_i
11
10
  @metrics = Hash.new
11
+ @action = action
12
12
  end
13
13
 
14
14
  def graphite_formatted
@@ -31,7 +31,7 @@ class ChefMetrics < Chef::Handler
31
31
  @metrics[:fail] = 1
32
32
  end
33
33
  if @action
34
- @action.call
34
+ self.instance_eval(&@action)
35
35
  else
36
36
  Chef::Log.info("Chef Metrics report handler was not provided an action")
37
37
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-metrics
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Porter