summaryrefslogtreecommitdiffstats
path: root/python.d/tomcat.chart.py
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
commit61aedf201c2c4bf0e5aa4db32e74f4d860b88593 (patch)
treebcf4f9a0cd8bc2daf38b2ff9f29bfcc1e5ed8968 /python.d/tomcat.chart.py
parentNew upstream version 1.8.0+dfsg (diff)
downloadnetdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.tar.xz
netdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.zip
New upstream version 1.9.0+dfsgupstream/1.9.0+dfsg
Diffstat (limited to 'python.d/tomcat.chart.py')
-rw-r--r--python.d/tomcat.chart.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/python.d/tomcat.chart.py b/python.d/tomcat.chart.py
index 05547236a..a570d5643 100644
--- a/python.d/tomcat.chart.py
+++ b/python.d/tomcat.chart.py
@@ -2,9 +2,10 @@
# Description: tomcat netdata python.d module
# Author: Pawel Krupa (paulfantom)
-from base import UrlService
import xml.etree.ElementTree as ET
+from bases.FrameworkServices.UrlService import UrlService
+
# default module values (can be overridden per job in `config`)
# update_every = 2
priority = 60000
@@ -71,6 +72,7 @@ CHARTS = {
]},
}
+
class Service(UrlService):
def __init__(self, configuration=None, name=None):
UrlService.__init__(self, configuration=configuration, name=name)
@@ -87,7 +89,6 @@ class Service(UrlService):
data = None
raw_data = self._get_raw_data()
if raw_data:
- xml = None
try:
xml = ET.fromstring(raw_data)
except ET.ParseError:
@@ -100,27 +101,27 @@ class Service(UrlService):
connector = None
if self.connector_name:
for conn in xml.findall('connector'):
- if conn.get('name') == self.connector_name:
+ if self.connector_name in conn.get('name'):
connector = conn
break
else:
connector = xml.find('connector')
memory = jvm.find('memory')
- data['free'] = memory.get('free')
+ data['free'] = memory.get('free')
data['total'] = memory.get('total')
for pool in jvm.findall('memorypool'):
name = pool.get('name')
- if name == 'Eden Space':
+ if 'Eden Space' in name:
data['eden_used'] = pool.get('usageUsed')
data['eden_commited'] = pool.get('usageCommitted')
data['eden_max'] = pool.get('usageMax')
- elif name == 'Survivor Space':
+ elif 'Survivor Space' in name:
data['survivor_used'] = pool.get('usageUsed')
data['survivor_commited'] = pool.get('usageCommitted')
data['survivor_max'] = pool.get('usageMax')
- elif name == 'Tenured Gen':
+ elif 'Tenured Gen' in name or 'Old Gen' in name:
data['tenured_used'] = pool.get('usageUsed')
data['tenured_commited'] = pool.get('usageCommitted')
data['tenured_max'] = pool.get('usageMax')