chef-handler-statsd 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/chef-handler-statsd.gemspec +1 -1
- data/lib/chef-handler-statsd.rb +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b431c25cbbace51ce5123709626b20da3f798747cb91943bbc61a2ef3f27d13
|
4
|
+
data.tar.gz: c7ed8a8f4b0266ae41bcd23b18f947a94a64d4c8fc1e89fbe4bbb58c39b30ace
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8732d8201aabe156971891c1f7c5b59d825ff9df1a1aff786f1b47f2e437a07a499cd0d54379cdb40dab44646eb28f5622237fce4e56d6e9c74af2c18412625
|
7
|
+
data.tar.gz: ebc649f4f72f72de58193a79c349f5a5fb7063dc4d68b1f7e68cf29f080cdc470826572a2146ef16d08b6dbaa375263910921f5a5c057a3642adbde3b5c1413e
|
data/chef-handler-statsd.gemspec
CHANGED
data/lib/chef-handler-statsd.rb
CHANGED
@@ -4,8 +4,9 @@ require 'chef/handler'
|
|
4
4
|
require 'datadog/statsd'
|
5
5
|
|
6
6
|
class ChefHandlerStatsd < Chef::Handler
|
7
|
-
def initialize(host = 'localhost', port = 8125)
|
7
|
+
def initialize(host = 'localhost', port = 8125, tags = {})
|
8
8
|
@statsd = Datadog::Statsd.new(host, port)
|
9
|
+
@tags = tags
|
9
10
|
end
|
10
11
|
|
11
12
|
def report
|
@@ -13,15 +14,17 @@ class ChefHandlerStatsd < Chef::Handler
|
|
13
14
|
nodeName: node.name
|
14
15
|
}
|
15
16
|
|
17
|
+
tags.merge!(@tags)
|
18
|
+
|
16
19
|
@statsd.count('chef-client.total_runs', 1, tags: tags)
|
17
|
-
@statsd.timing('chef-client.run_time', run_status.elapsed_time * 1000, tags: tags)
|
20
|
+
@statsd.timing('chef-client.run_time', (run_status.elapsed_time * 1000), tags: tags)
|
18
21
|
@statsd.count('chef-client.total_resources', run_status.all_resources.length, tags: tags)
|
19
22
|
@statsd.count('chef-client.updated_resources', run_status.updated_resources.length, tags: tags)
|
20
23
|
|
21
24
|
if run_status.failed?
|
22
|
-
@statsd.count('chef-client.failed_runs', tags: tags)
|
25
|
+
@statsd.count('chef-client.failed_runs', 1, tags: tags)
|
23
26
|
else
|
24
|
-
@statsd.count('chef-client.success_runs', tags: tags)
|
27
|
+
@statsd.count('chef-client.success_runs', 1, tags: tags)
|
25
28
|
end
|
26
29
|
end
|
27
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-handler-statsd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig Thayer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dogstatsd-ruby
|