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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3f4d5609e65f11b19edcedef02862a2e2ff8f54197c16c08da56b9b4436bb93
4
- data.tar.gz: e31026170b08f3c214d878743c2999b1cf312ae2f6b5b1bdd688b5892eb4c02a
3
+ metadata.gz: 2b431c25cbbace51ce5123709626b20da3f798747cb91943bbc61a2ef3f27d13
4
+ data.tar.gz: c7ed8a8f4b0266ae41bcd23b18f947a94a64d4c8fc1e89fbe4bbb58c39b30ace
5
5
  SHA512:
6
- metadata.gz: 80eb83c6bdba972fe75c0d320a26727a0178e544f22e8f305e1966c3a05b0ef42f5492cd8ba5d9350cf50ad8da2a6a1f2bbc74639be872991bf5b4bbf55db7b2
7
- data.tar.gz: 6bcccb63f1db7ad1c59598b9ab9d0a9825fa1f4d7a25e187718e743e2a17e8c457a243808ffafaff5e7e3f1b4f2c880cf5296f4997b60e40c937dd507363a651
6
+ metadata.gz: d8732d8201aabe156971891c1f7c5b59d825ff9df1a1aff786f1b47f2e437a07a499cd0d54379cdb40dab44646eb28f5622237fce4e56d6e9c74af2c18412625
7
+ data.tar.gz: ebc649f4f72f72de58193a79c349f5a5fb7063dc4d68b1f7e68cf29f080cdc470826572a2146ef16d08b6dbaa375263910921f5a5c057a3642adbde3b5c1413e
@@ -9,7 +9,7 @@ Gem::Specification.new do |gem|
9
9
  gem.files = `git ls-files`.split($\)
10
10
  gem.name = "chef-handler-statsd"
11
11
  gem.require_paths = ["lib"]
12
- gem.version = "1.0.0"
12
+ gem.version = "1.0.1"
13
13
 
14
14
  gem.add_dependency 'dogstatsd-ruby', '~> 4.5.0'
15
15
  end
@@ -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.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-06 00:00:00.000000000 Z
11
+ date: 2019-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dogstatsd-ruby