diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:19:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:20:17 +0000 |
commit | a64a253794ac64cb40befee54db53bde17dd0d49 (patch) | |
tree | c1024acc5f6e508814b944d99f112259bb28b1be /collectors/python.d.plugin/tomcat/tomcat.chart.py | |
parent | New upstream version 1.10.0+dfsg (diff) | |
download | netdata-upstream/1.11.0+dfsg.tar.xz netdata-upstream/1.11.0+dfsg.zip |
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | collectors/python.d.plugin/tomcat/tomcat.chart.py (renamed from python.d/tomcat.chart.py) | 110 |
1 files changed, 60 insertions, 50 deletions
diff --git a/python.d/tomcat.chart.py b/collectors/python.d.plugin/tomcat/tomcat.chart.py index a570d5643..3c2d0ed40 100644 --- a/python.d/tomcat.chart.py +++ b/collectors/python.d.plugin/tomcat/tomcat.chart.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- # Description: tomcat netdata python.d module # Author: Pawel Krupa (paulfantom) +# Author: Wei He (Wing924) +# SPDX-License-Identifier: GPL-3.0-or-later import xml.etree.ElementTree as ET @@ -16,67 +18,75 @@ ORDER = ['accesses', 'bandwidth', 'processing_time', 'threads', 'jvm', 'jvm_eden CHARTS = { 'accesses': { - 'options': [None, "Requests", "requests/s", "statistics", "tomcat.accesses", "area"], + 'options': [None, 'Requests', 'requests/s', 'statistics', 'tomcat.accesses', 'area'], 'lines': [ - ["requestCount", 'accesses', 'incremental'], - ["errorCount", 'errors', 'incremental'], - ]}, + ['requestCount', 'accesses', 'incremental'], + ['errorCount', 'errors', 'incremental'], + ] + }, 'bandwidth': { - 'options': [None, "Bandwidth", "KB/s", "statistics", "tomcat.bandwidth", "area"], + 'options': [None, 'Bandwidth', 'KB/s', 'statistics', 'tomcat.bandwidth', 'area'], 'lines': [ - ["bytesSent", 'sent', 'incremental', 1, 1024], - ["bytesReceived", 'received', 'incremental', 1, 1024], - ]}, + ['bytesSent', 'sent', 'incremental', 1, 1024], + ['bytesReceived', 'received', 'incremental', 1, 1024], + ] + }, 'processing_time': { - 'options': [None, "processing time", "seconds", "statistics", "tomcat.processing_time", "area"], + 'options': [None, 'processing time', 'seconds', 'statistics', 'tomcat.processing_time', 'area'], 'lines': [ - ["processingTime", 'processing time', 'incremental', 1, 1000] - ]}, + ['processingTime', 'processing time', 'incremental', 1, 1000] + ] + }, 'threads': { - 'options': [None, "Threads", "current threads", "statistics", "tomcat.threads", "area"], + 'options': [None, 'Threads', 'current threads', 'statistics', 'tomcat.threads', 'area'], 'lines': [ - ["currentThreadCount", 'current', "absolute"], - ["currentThreadsBusy", 'busy', "absolute"] - ]}, + ['currentThreadCount', 'current', 'absolute'], + ['currentThreadsBusy', 'busy', 'absolute'] + ] + }, 'jvm': { - 'options': [None, "JVM Memory Pool Usage", "MB", "memory", "tomcat.jvm", "stacked"], + 'options': [None, 'JVM Memory Pool Usage', 'MB', 'memory', 'tomcat.jvm', 'stacked'], 'lines': [ - ["free", 'free', "absolute", 1, 1048576], - ["eden_used", 'eden', "absolute", 1, 1048576], - ["survivor_used", 'survivor', "absolute", 1, 1048576], - ["tenured_used", 'tenured', "absolute", 1, 1048576], - ["code_cache_used", 'code cache', "absolute", 1, 1048576], - ["compressed_used", 'compressed', "absolute", 1, 1048576], - ["metaspace_used", 'metaspace', "absolute", 1, 1048576], - ]}, + ['free', 'free', 'absolute', 1, 1048576], + ['eden_used', 'eden', 'absolute', 1, 1048576], + ['survivor_used', 'survivor', 'absolute', 1, 1048576], + ['tenured_used', 'tenured', 'absolute', 1, 1048576], + ['code_cache_used', 'code cache', 'absolute', 1, 1048576], + ['compressed_used', 'compressed', 'absolute', 1, 1048576], + ['metaspace_used', 'metaspace', 'absolute', 1, 1048576], + ] + }, 'jvm_eden': { - 'options': [None, "Eden Memory Usage", "MB", "memory", "tomcat.jvm_eden", "area"], + 'options': [None, 'Eden Memory Usage', 'MB', 'memory', 'tomcat.jvm_eden', 'area'], 'lines': [ - ["eden_used", 'used', "absolute", 1, 1048576], - ["eden_commited", 'commited', "absolute", 1, 1048576], - ["eden_max", 'max', "absolute", 1, 1048576] - ]}, + ['eden_used', 'used', 'absolute', 1, 1048576], + ['eden_committed', 'committed', 'absolute', 1, 1048576], + ['eden_max', 'max', 'absolute', 1, 1048576] + ] + }, 'jvm_survivor': { - 'options': [None, "Survivor Memory Usage", "MB", "memory", "tomcat.jvm_survivor", "area"], + 'options': [None, 'Survivor Memory Usage', 'MB', 'memory', 'tomcat.jvm_survivor', 'area'], 'lines': [ - ["survivor_used", 'used', "absolute", 1, 1048576], - ["survivor_commited", 'commited', "absolute", 1, 1048576], - ["survivor_max", 'max', "absolute", 1, 1048576] - ]}, + ['survivor_used', 'used', 'absolute', 1, 1048576], + ['survivor_committed', 'committed', 'absolute', 1, 1048576], + ['survivor_max', 'max', 'absolute', 1, 1048576] + ] + }, 'jvm_tenured': { - 'options': [None, "Tenured Memory Usage", "MB", "memory", "tomcat.jvm_tenured", "area"], + 'options': [None, 'Tenured Memory Usage', 'MB', 'memory', 'tomcat.jvm_tenured', 'area'], 'lines': [ - ["tenured_used", 'used', "absolute", 1, 1048576], - ["tenured_commited", 'commited', "absolute", 1, 1048576], - ["tenured_max", 'max', "absolute", 1, 1048576] - ]}, + ['tenured_used', 'used', 'absolute', 1, 1048576], + ['tenured_committed', 'committed', 'absolute', 1, 1048576], + ['tenured_max', 'max', 'absolute', 1, 1048576] + ] + } } class Service(UrlService): def __init__(self, configuration=None, name=None): UrlService.__init__(self, configuration=configuration, name=name) - self.url = self.configuration.get('url', "http://127.0.0.1:8080/manager/status?XML=true") + self.url = self.configuration.get('url', 'http://127.0.0.1:8080/manager/status?XML=true') self.connector_name = self.configuration.get('connector_name', None) self.order = ORDER self.definitions = CHARTS @@ -115,27 +125,27 @@ class Service(UrlService): name = pool.get('name') if 'Eden Space' in name: data['eden_used'] = pool.get('usageUsed') - data['eden_commited'] = pool.get('usageCommitted') + data['eden_committed'] = pool.get('usageCommitted') data['eden_max'] = pool.get('usageMax') elif 'Survivor Space' in name: data['survivor_used'] = pool.get('usageUsed') - data['survivor_commited'] = pool.get('usageCommitted') + data['survivor_committed'] = pool.get('usageCommitted') data['survivor_max'] = pool.get('usageMax') elif 'Tenured Gen' in name or 'Old Gen' in name: data['tenured_used'] = pool.get('usageUsed') - data['tenured_commited'] = pool.get('usageCommitted') + data['tenured_committed'] = pool.get('usageCommitted') data['tenured_max'] = pool.get('usageMax') elif name == 'Code Cache': data['code_cache_used'] = pool.get('usageUsed') - data['code_cache_commited'] = pool.get('usageCommitted') + data['code_cache_committed'] = pool.get('usageCommitted') data['code_cache_max'] = pool.get('usageMax') elif name == 'Compressed': data['compressed_used'] = pool.get('usageUsed') - data['compressed_commited'] = pool.get('usageCommitted') + data['compressed_committed'] = pool.get('usageCommitted') data['compressed_max'] = pool.get('usageMax') elif name == 'Metaspace': data['metaspace_used'] = pool.get('usageUsed') - data['metaspace_commited'] = pool.get('usageCommitted') + data['metaspace_committed'] = pool.get('usageCommitted') data['metaspace_max'] = pool.get('usageMax') if connector: @@ -145,9 +155,9 @@ class Service(UrlService): request_info = connector.find('requestInfo') data['processingTime'] = request_info.get('processingTime') - data['requestCount'] = request_info.get('requestCount') - data['errorCount'] = request_info.get('errorCount') - data['bytesReceived'] = request_info.get('bytesReceived') - data['bytesSent'] = request_info.get('bytesSent') + data['requestCount'] = request_info.get('requestCount') + data['errorCount'] = request_info.get('errorCount') + data['bytesReceived'] = request_info.get('bytesReceived') + data['bytesSent'] = request_info.get('bytesSent') return data or None |