jmx_client-parser 0.0.1 → 0.0.2
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 +4 -4
- data/lib/jmx_client/parser.rb +8 -0
- data/lib/jmx_client/parser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20db4b32f1fe90c8352fec65f54019a13825b2cb
|
4
|
+
data.tar.gz: 6328615f12122070e1d75b42f25d4a6afde52805
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22fe1199d4c9f0c0ef558160ce3ebfb33674df2833e5b9c9362e70b0a013ac50682316597f92fbdb18c2ff8549cd9690c32651350631ea9af4d658766c577c2a
|
7
|
+
data.tar.gz: 97a8a6c30664239508aec451d08bffe03a220de8acf630d84500e8bf766c5e0b42e4deb1be8fe267d1c0c17f4b4fa7592332057f5f3f9288dce70e1d6c3f21be
|
data/lib/jmx_client/parser.rb
CHANGED
@@ -39,6 +39,9 @@ module JmxClient
|
|
39
39
|
def parse_all_output(cmd_output, formatted_output = {})
|
40
40
|
if cmd_output.nil? || cmd_output.empty?
|
41
41
|
return formatted_output
|
42
|
+
elsif bean_not_registered?(cmd_output)
|
43
|
+
remaining = drop_first_line(cmd_output)
|
44
|
+
return parse_all_output(remaining, formatted_output)
|
42
45
|
elsif single_line?(cmd_output)
|
43
46
|
remaining, formatted = parse_single_line(cmd_output)
|
44
47
|
return parse_all_output(remaining, formatted_output.merge(formatted))
|
@@ -48,6 +51,11 @@ module JmxClient
|
|
48
51
|
end
|
49
52
|
end
|
50
53
|
|
54
|
+
def bean_not_registered?(output)
|
55
|
+
regex = %r(is not a registered bean)
|
56
|
+
output.dup.split("\n").shift.chomp.match(regex)
|
57
|
+
end
|
58
|
+
|
51
59
|
def single_line?(output)
|
52
60
|
regex = %r(^
|
53
61
|
[0-9/]+\s+ # Matches calendar day, like 12/12/2013.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jmx_client-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Oman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|