fluent-plugin-zookeeper-mntr 0.0.2 → 0.0.3

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: 8693dfce3d591db197fde917322c9433e47992707e1621bf6d18831056dfe266
4
- data.tar.gz: d2529b37adabbedbc99b7c53022cdd5fbbe1389b6a94714b007f17edb03a8961
3
+ metadata.gz: bda63954af8d01fce8496bd736056b700db85fa84b830762a566d85a73d1aa82
4
+ data.tar.gz: 95fd26545fd64ef298b0088f77aa629d13d7d5f428b987fd18bdd1921dd9caf3
5
5
  SHA512:
6
- metadata.gz: a3e76ae39b8978e7e7a108a4880211dacbcecd59acb8c50404fcc7f9a6b270c9e4a9aa6d40d408a01a157c621ecc30b842195dac54bed81717dfcb3a614fc0c5
7
- data.tar.gz: e203ce847c1b88671fe08632a601e8c2de7b5e4c24f1136deae6aa448288429dc6b7b4ff4c0e231c2248f4f04d3be9cbf8b809cb333edd6273c56b65c1552c15
6
+ metadata.gz: c48c9140eec80f65c7096d8516d77e36af11b890dfd9ccfe2f6a75e3a3bd4ba4611a980ea974f445dcf27b6c7536b944a92fef49eba18b2bb6051b98b77bb4d9
7
+ data.tar.gz: d49285390013bba1190636376e7cb30868d7d4f59f3b5aa25c66b52ae13e92383a4bf1f2c16f91c957ebc8d09b35d6762e0f2823fba8b4f38748a1f7ec059462
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.0.3
2
+
3
+ ENHANCEMENTS:
4
+
5
+ * Report errors in a well formed way.
6
+ * Typecast integer statistics to integers.
7
+
1
8
  ## 0.0.2
2
9
 
3
10
  ENHANCEMENTS:
@@ -40,11 +40,25 @@ module Fluent
40
40
  socket_create_tcp(@host, @port) do |socket|
41
41
  socket.write('mntr')
42
42
  data = socket.read
43
- message = Hash[
44
- data.split("\n").map { |row| row.split("\t") }
45
- ]
43
+ message =
44
+ if data.start_with?('This ZooKeeper')
45
+ { 'error' => data }
46
+ else
47
+ Hash[data.split("\n").map! { |row| row.split("\t") }]
48
+ end
49
+
50
+ message.transform_values do |value|
51
+ if value =~ /\A[0-9]+\z/
52
+ value.to_i
53
+ else
54
+ value
55
+ end
56
+ end
57
+
46
58
  router.emit(@tag, Fluent::EventTime.now, message)
47
59
  end
60
+ rescue StandardError => exc
61
+ router.emit(@tag, Fluent::EventTime.now, { 'error' => exc.message })
48
62
  end
49
63
  end
50
64
  end
@@ -18,7 +18,7 @@ module Fluent
18
18
  module Plugin
19
19
  module Zookeeper
20
20
  module Mntr
21
- VERSION = "0.0.2"
21
+ VERSION = "0.0.3"
22
22
  end
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-zookeeper-mntr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Scarborough
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-04 00:00:00.000000000 Z
11
+ date: 2022-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake