sensu-plugins-twemproxy 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c34240453273038c9d2dbe8a4c37edd0937c69e
4
- data.tar.gz: 76db56987e9b35aa567554e1fe3c9de5108d4931
3
+ metadata.gz: 755736c573b0f2ca0b07b8d7e6508025db039fc7
4
+ data.tar.gz: 07f8b0424a3061d9be7f2542ccd9e692910af764
5
5
  SHA512:
6
- metadata.gz: 59e2db821b250ef5bf929d24374ca0f91c00f25077f46826a6ec04f404a5c5cf4678d6c4fb241858614594d5465c5b970870d2bd26b570f644ce2860116aadd4
7
- data.tar.gz: 3782bec33462c7e3b074f32bea5775440f0f2d6a096294c41a9e467e74481615f015b4c37d1ad8d74266ac7460465caa0035abc5f88a768076ff636ea60279f2
6
+ metadata.gz: 91b653d4684e1970498d4b85823db7b2ac5b79140235f5c4969b751fc02dc2d6697e86e35ce81c792ea99e857d5a2df61dea2d27692d042fbc9142d992dccc27
7
+ data.tar.gz: 2694fd8e5b2b4ffa0a764fe846c303b5ef01ed80c576fef86ddba93802a027ccb5664bb813af994c7c24d3e1313307c777dcb1c61959defa5b86cfe016a5b243
@@ -1,9 +1,16 @@
1
- #Change Log
1
+ # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
6
  ## [Unreleased]
7
+ ## [1.0.1] 2017-07-10
8
+ ### Fixed
9
+ - Update ignored JSON keys to prevent script crashing out (@Evesy)
10
+
11
+ ### Added
12
+ - Config option to provide alternative list of keys to ignore (@Evesy)
13
+
7
14
  ## [1.0.0] - 2017-07-09
8
15
  ### Added
9
16
  - Testing on Ruby 2.3.0 & 2.4.1 (@Evesy)
@@ -27,6 +34,7 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
27
34
  - initial release
28
35
 
29
36
  [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-twemproxy/compare/1.0.0...HEAD
37
+ [1.0.1]: https://github.com/sensu-plugins/sensu-plugins-twemproxy/compare/1.0.0...1.0.1
30
38
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-twemproxy/compare/0.0.3...1.0.0
31
39
  [0.0.3]: https://github.com/sensu-plugins/sensu-plugins-twemproxy/compare/0.0.2...0.0.3
32
40
  [0.0.2]: https://github.com/sensu-plugins/sensu-plugins-twemproxy/compare/0.0.1...0.0.2
@@ -36,7 +36,7 @@ require 'json'
36
36
  # Twemproxy metrics
37
37
  #
38
38
  class Twemproxy2Graphite < Sensu::Plugin::Metric::CLI::Graphite
39
- SKIP_ROOT_KEYS = %w(service source version uptime timestamp).freeze
39
+ SKIP_KEYS = %w(service source version uptime timestamp total_connections curr_connections).freeze
40
40
 
41
41
  option :host,
42
42
  description: 'Twemproxy stats host to connect to',
@@ -68,11 +68,22 @@ class Twemproxy2Graphite < Sensu::Plugin::Metric::CLI::Graphite
68
68
  proc: proc(&:to_i),
69
69
  default: 5
70
70
 
71
+ option :skip_keys,
72
+ description: 'Keys to skip when looping through metrics (Comma seperated)',
73
+ short: '-k KEYS',
74
+ long: '--skip-keys KEYS'
75
+
71
76
  def run
77
+ skip_keys = if config[:skip_keys]
78
+ config[:skip_keys].split(',')
79
+ else
80
+ SKIP_KEYS
81
+ end
82
+
72
83
  Timeout.timeout(config[:timeout]) do
73
84
  sock = TCPSocket.new(config[:host], config[:port])
74
85
  data = JSON.parse(sock.read)
75
- pools = data.keys - SKIP_ROOT_KEYS
86
+ pools = data.keys - skip_keys
76
87
 
77
88
  pools.each do |pool_key|
78
89
  data[pool_key].each do |key, value|
@@ -2,7 +2,7 @@ module SensuPluginsTwemproxy
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-twemproxy
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
  - Sensu-Plugins and contributors