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 +1 -1
- data/lib/chef-metrics.rb +4 -4
- metadata +3 -3
data/chef-metrics.gemspec
CHANGED
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 :
|
5
|
+
attr_accessor :metric_scheme, :measure_time, :metrics, :action
|
6
6
|
|
7
7
|
def initialize(&action)
|
8
|
-
@
|
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
|
-
|
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Porter
|