sensu-plugins-kafka 0.9.0 → 0.9.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: 0a503a49eba3fdde83ea058f05aa528e880e88d3
4
- data.tar.gz: 987863996d1810bb470709f75141a9f6e5c6d752
3
+ metadata.gz: 8b183d4a82da442f67d93145f8988f110873107b
4
+ data.tar.gz: ec3f82c37e683b17f5ff5fb2d3b67d46bf368b58
5
5
  SHA512:
6
- metadata.gz: b48c13220791bec9f7d77e9502865bb208c91cc1767fb70788baa13a4329d05bb17449979ab76c39ded7e5f92666900945c86d59e04cd0e1927f0315d921aabc
7
- data.tar.gz: 04d858babaebd2080e08adc7e0d34a879a384ea3899bea6b6e1c8e374e5dda15340df03606d7575da410342dc61325fa8e8b8d6df5673c73d1294a2a89a9de2d
6
+ metadata.gz: dd5c2c768a9d9169e68b4bd3a85f099dce72b3d58d20ac02a471802a057dc0baf736bb11dfd641ecc197e2a8955eceb54d7ede3575dac582001163a0d8066b77
7
+ data.tar.gz: 9b14fe6c4587ebbf855f5e57651810ac578ce8ee677303b411befc872dfee7f33a6c7b2144454b50a9073c81dc6afdc9964d8b912cb8dd64f69caa10976aa2ac
data/CHANGELOG.md CHANGED
@@ -10,6 +10,11 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
10
10
  ### Fixed
11
11
  ### Changed
12
12
 
13
+ ## [0.9.1] - 2017-02-16
14
+
15
+ ### Fixed
16
+ - add missing methods
17
+
13
18
  ## [0.9.0] - 2017-02-16
14
19
 
15
20
  ### Breaking Changes
@@ -60,6 +60,24 @@ class ConsumerOffsetMetrics < Sensu::Plugin::Metric::CLI::Graphite
60
60
  long: '--zookeeper NAME',
61
61
  default: 'localhost:2181'
62
62
 
63
+ def kafka_topics(zk, group)
64
+ zk.get_children(path: "/consumers/#{group}/owners")[:children].sort
65
+ end
66
+
67
+ def topics_partitions(zk, topic)
68
+ JSON.parse(zk.get(path: "/brokers/topics/#{topic}")[:data])['partitions'].keys.map(&:to_i).sort
69
+ end
70
+
71
+ def leader_broker(zk, topic, partition)
72
+ state = zk.get(path: "/brokers/topics/#{topic}/partitions/#{partition}/state")
73
+ leader = JSON.parse(state[:data])['leader']
74
+ JSON.parse(zk.get(path: "/brokers/ids/#{leader}")[:data])
75
+ end
76
+
77
+ def consumer_offset(zk, group, topic, partition)
78
+ zk.get(path: "/consumers/#{group}/offsets/#{topic}/#{partition}")[:data].to_i
79
+ end
80
+
63
81
  def run
64
82
  z = Zookeeper.new(config[:zookeeper])
65
83
 
@@ -6,7 +6,7 @@ module SensuPluginsKafka
6
6
  module Version
7
7
  MAJOR = 0
8
8
  MINOR = 9
9
- PATCH = 0
9
+ PATCH = 1
10
10
 
11
11
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors