From 1564580601b5241bd642c1bb1790897aaa2302aa Mon Sep 17 00:00:00 2001 From: Raimbek Egemberdiev Date: Tue, 16 May 2017 13:53:02 +0600 Subject: [PATCH 1/2] Include xa-datasource statistics to app metrics --- src/collectors/jbossapi/jbossapi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/collectors/jbossapi/jbossapi.py b/src/collectors/jbossapi/jbossapi.py index 70d52c4dc..6c7feeb23 100644 --- a/src/collectors/jbossapi/jbossapi.py +++ b/src/collectors/jbossapi/jbossapi.py @@ -208,6 +208,9 @@ def get_stats(self, current_host, current_port, current_proto, current_user, if op_type == 'app' and self.config['app_stats'] == 'True': if output: # Grab the pool stats for each Instance + if 'xa-data-source' in output['result']: + output['result']['data-source'].update(output['result']['xa-data-source']) + for instance in output['result']['data-source']: datasource = output['result']['data-source'][instance] for metric in datasource['statistics']['pool']: @@ -374,7 +377,6 @@ def string_regex(self, pattern, s): return tmp_result.group(1) def collect(self): - for host in self.config['hosts']: matches = re.search( '^([^:]*):([^@]*)@([^:]*):([^:]*):?(.*)', host) @@ -387,7 +389,7 @@ def collect(self): current_proto = matches.group(5) current_user = matches.group(1) current_pword = matches.group(2) - + # Call get_stats for each instance of jboss self.get_stats(current_host, current_port, current_proto, current_user, current_pword) From f29e4745d06d77eb872dc3eda33a872b3bca8fc5 Mon Sep 17 00:00:00 2001 From: raimbek Date: Wed, 17 May 2017 00:05:52 +0600 Subject: [PATCH 2/2] reverted unnecessary changes --- src/collectors/jbossapi/jbossapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/collectors/jbossapi/jbossapi.py b/src/collectors/jbossapi/jbossapi.py index 6c7feeb23..633e160a3 100644 --- a/src/collectors/jbossapi/jbossapi.py +++ b/src/collectors/jbossapi/jbossapi.py @@ -377,6 +377,7 @@ def string_regex(self, pattern, s): return tmp_result.group(1) def collect(self): + for host in self.config['hosts']: matches = re.search( '^([^:]*):([^@]*)@([^:]*):([^:]*):?(.*)', host) @@ -389,7 +390,7 @@ def collect(self): current_proto = matches.group(5) current_user = matches.group(1) current_pword = matches.group(2) - + # Call get_stats for each instance of jboss self.get_stats(current_host, current_port, current_proto, current_user, current_pword)