diff options
author | Austin S. Hemmelgarn <ahferroin7@gmail.com> | 2018-09-28 19:00:38 -0400 |
---|---|---|
committer | Costa Tsaousis <costa@tsaousis.gr> | 2018-09-29 02:00:38 +0300 |
commit | f8b161eb00ec852350057f404e0c207c3c5192e2 (patch) | |
tree | 376878aff0f4b76047c13016697c29fcb4483b57 | |
parent | 2c826768da768da3f913d7558a9e8b6c535ed337 (diff) |
Python.d PEP 8 cleanup, modules P-R (#4299)
* python.d/phpfph.chart.py PEP 8 cleanup
Fixed formatting of container literals.
* python.d/portcheck.chart.py PEP 8 cleanup
Fixed string quoting and container literal formatting.
* python.d/postfix.chart.py PEP 8 cleanup
Fixed string quoting and container literal formatting.
* python.d/powerdns.chart.py PEP 8 cleanup
Fixed formatting of container literals.
* python.d/puppet.chart.py PEP 8 cleanup
Fixed string quotation, use of blank lines, and formatting of block
comments.
* python.d/rabbitmq.chart.py PEP 8 cleanup
Fixed formatting of container literals.
Also fixes a misplaced space (located after a quotation mark instead of
before).
* python.d/redis.chart.py PEP 8 cleanup
Fixed formatting of container literals and quoting of string literals.
* python.d/rethinkdb.chart.py PEP 8 cleanup
Fixed formatting of container literals.
* python.d/retroshare.chart.py PEP 8 cleanup
Fixed formatting of container literals.
-rw-r--r-- | python.d/phpfpm.chart.py | 18 | ||||
-rw-r--r-- | python.d/portcheck.chart.py | 7 | ||||
-rw-r--r-- | python.d/postfix.chart.py | 14 | ||||
-rw-r--r-- | python.d/powerdns.chart.py | 50 | ||||
-rw-r--r-- | python.d/puppet.chart.py | 30 | ||||
-rw-r--r-- | python.d/rabbitmq.chart.py | 111 | ||||
-rw-r--r-- | python.d/redis.chart.py | 56 | ||||
-rw-r--r-- | python.d/rethinkdbs.chart.py | 14 | ||||
-rw-r--r-- | python.d/retroshare.chart.py | 9 |
9 files changed, 177 insertions, 132 deletions
diff --git a/python.d/phpfpm.chart.py b/python.d/phpfpm.chart.py index ab754d5fde..8921ae837d 100644 --- a/python.d/phpfpm.chart.py +++ b/python.d/phpfpm.chart.py @@ -60,18 +60,21 @@ CHARTS = { ['active'], ['maxActive', 'max active'], ['idle'] - ]}, + ] + }, 'requests': { 'options': [None, 'PHP-FPM Requests', 'requests/s', 'requests', 'phpfpm.requests', 'line'], 'lines': [ ['requests', None, 'incremental'] - ]}, + ] + }, 'performance': { 'options': [None, 'PHP-FPM Performance', 'status', 'performance', 'phpfpm.performance', 'line'], 'lines': [ ['reached', 'max children reached'], ['slow', 'slow requests'] - ]}, + ] + }, 'request_duration': { 'options': [None, 'PHP-FPM Request Duration', 'milliseconds', 'request duration', 'phpfpm.request_duration', 'line'], @@ -79,21 +82,24 @@ CHARTS = { ['minReqDur', 'min', 'absolute', 1, 1000], ['maxReqDur', 'max', 'absolute', 1, 1000], ['avgReqDur', 'avg', 'absolute', 1, 1000] - ]}, + ] + }, 'request_cpu': { 'options': [None, 'PHP-FPM Request CPU', 'percent', 'request CPU', 'phpfpm.request_cpu', 'line'], 'lines': [ ['minReqCpu', 'min'], ['maxReqCpu', 'max'], ['avgReqCpu', 'avg'] - ]}, + ] + }, 'request_mem': { 'options': [None, 'PHP-FPM Request Memory', 'kilobytes', 'request memory', 'phpfpm.request_mem', 'line'], 'lines': [ ['minReqMem', 'min', 'absolute', 1, 1024], ['maxReqMem', 'max', 'absolute', 1, 1024], ['avgReqMem', 'avg', 'absolute', 1, 1024] - ]} + ] + } } diff --git a/python.d/portcheck.chart.py b/python.d/portcheck.chart.py index b3ba8d0eb6..1fe8074b56 100644 --- a/python.d/portcheck.chart.py +++ b/python.d/portcheck.chart.py @@ -37,7 +37,8 @@ CHARTS = { [PORT_SUCCESS, 'success', 'absolute'], [PORT_TIMEOUT, 'timeout', 'absolute'], [PORT_FAILED, 'no connection', 'absolute'] - ]} + ] + } } @@ -57,13 +58,13 @@ class Service(SimpleService): :return: boolean """ if self.host is None or self.port is None: - self.error("Host or port missing") + self.error('Host or port missing') return False if not isinstance(self.port, int): self.error('"port" is not an integer. Specify a numerical value, not service name.') return False - self.debug("Enabled portcheck: {host}:{port}, update every {update}s, timeout: {timeout}s".format( + self.debug('Enabled portcheck: {host}:{port}, update every {update}s, timeout: {timeout}s'.format( host=self.host, port=self.port, update=self.update_every, timeout=self.timeout )) # We will accept any (valid-ish) configuration, even if initial connection fails (a service might be down from diff --git a/python.d/postfix.chart.py b/python.d/postfix.chart.py index 0ae9edad6a..28084af0e6 100644 --- a/python.d/postfix.chart.py +++ b/python.d/postfix.chart.py @@ -15,22 +15,24 @@ ORDER = ['qemails', 'qsize'] CHARTS = { 'qemails': { - 'options': [None, "Postfix Queue Emails", "emails", 'queue', 'postfix.qemails', 'line'], + 'options': [None, 'Postfix Queue Emails', 'emails', 'queue', 'postfix.qemails', 'line'], 'lines': [ ['emails', None, 'absolute'] - ]}, + ] + }, 'qsize': { - 'options': [None, "Postfix Queue Emails Size", "emails size in KB", 'queue', 'postfix.qsize', 'area'], + 'options': [None, 'Postfix Queue Emails Size', 'emails size in KB', 'queue', 'postfix.qsize', 'area'], 'lines': [ - ["size", None, 'absolute'] - ]} + ['size', None, 'absolute'] + ] + } } class Service(ExecutableService): def __init__(self, configuration=None, name=None): ExecutableService.__init__(self, configuration=configuration, name=name) - self.command = "postqueue -p" + self.command = 'postqueue -p' self.order = ORDER self.definitions = CHARTS diff --git a/python.d/powerdns.chart.py b/python.d/powerdns.chart.py index 74f8dbad87..af9dddf917 100644 --- a/python.d/powerdns.chart.py +++ b/python.d/powerdns.chart.py @@ -21,7 +21,8 @@ CHARTS = { ['udp-answers', None, 'incremental'], ['tcp-queries', None, 'incremental'], ['tcp-answers', None, 'incremental'] - ]}, + ] + }, 'cache_usage': { 'options': [None, 'PowerDNS Cache Usage', 'count', 'cache', 'powerdns.cache_usage', 'line'], 'lines': [ @@ -29,7 +30,8 @@ CHARTS = { ['query-cache-miss', None, 'incremental'], ['packetcache-hit', 'packet-cache-hit', 'incremental'], ['packetcache-miss', 'packet-cache-miss', 'incremental'] - ]}, + ] + }, 'cache_size': { 'options': [None, 'PowerDNS Cache Size', 'count', 'cache', 'powerdns.cache_size', 'line'], 'lines': [ @@ -37,58 +39,64 @@ CHARTS = { ['packetcache-size', 'packet-cache-size', 'absolute'], ['key-cache-size', None, 'absolute'], ['meta-cache-size', None, 'absolute'] - ]}, + ] + }, 'latency': { 'options': [None, 'PowerDNS Latency', 'microseconds', 'latency', 'powerdns.latency', 'line'], 'lines': [ ['latency', None, 'absolute'] - ]} - + ] + } } RECURSOR_ORDER = ['questions-in', 'questions-out', 'answer-times', 'timeouts', 'drops', 'cache_usage', 'cache_size'] RECURSOR_CHARTS = { 'questions-in': { - 'options': [ - None, 'PowerDNS Recursor Questions In', 'count', 'questions', 'powerdns_recursor.questions-in', 'line'], + 'options': [None, 'PowerDNS Recursor Questions In', 'count', 'questions', 'powerdns_recursor.questions-in', + 'line'], 'lines': [ ['questions', None, 'incremental'], ['ipv6-questions', None, 'incremental'], ['tcp-questions', None, 'incremental'] - ]}, + ] + }, 'questions-out': { - 'options': [ - None, 'PowerDNS Recursor Questions Out', 'count', 'questions', 'powerdns_recursor.questions-out', 'line'], + 'options': [None, 'PowerDNS Recursor Questions Out', 'count', 'questions', 'powerdns_recursor.questions-out', + 'line'], 'lines': [ ['all-outqueries', None, 'incremental'], ['ipv6-outqueries', None, 'incremental'], ['tcp-outqueries', None, 'incremental'], ['throttled-outqueries', None, 'incremental'] - ]}, + ] + }, 'answer-times': { - 'options': [ - None, 'PowerDNS Recursor Answer Times', 'count', 'performance', 'powerdns_recursor.answer-times', 'line'], + 'options': [None, 'PowerDNS Recursor Answer Times', 'count', 'performance', 'powerdns_recursor.answer-times', + 'line'], 'lines': [ ['answers-slow', None, 'incremental'], ['answers0-1', None, 'incremental'], ['answers1-10', None, 'incremental'], ['answers10-100', None, 'incremental'], ['answers100-1000', None, 'incremental'] - ]}, + ] + }, 'timeouts': { - 'options': [ - None, 'PowerDNS Recursor Questions Time', 'count', 'performance', 'powerdns_recursor.timeouts', 'line'], + 'options': [None, 'PowerDNS Recursor Questions Time', 'count', 'performance', 'powerdns_recursor.timeouts', + 'line'], 'lines': [ ['outgoing-timeouts', None, 'incremental'], ['outgoing4-timeouts', None, 'incremental'], ['outgoing6-timeouts', None, 'incremental'] - ]}, + ] + }, 'drops': { 'options': [None, 'PowerDNS Recursor Drops', 'count', 'performance', 'powerdns_recursor.drops', 'line'], 'lines': [ ['over-capacity-drops', None, 'incremental'] - ]}, + ] + }, 'cache_usage': { 'options': [None, 'PowerDNS Recursor Cache Usage', 'count', 'cache', 'powerdns_recursor.cache_usage', 'line'], 'lines': [ @@ -96,14 +104,16 @@ RECURSOR_CHARTS = { ['cache-misses', None, 'incremental'], ['packetcache-hits', 'packet-cache-hit', 'incremental'], ['packetcache-misses', 'packet-cache-miss', 'incremental'] - ]}, + ] + }, 'cache_size': { 'options': [None, 'PowerDNS Recursor Cache Size', 'count', 'cache', 'powerdns_recursor.cache_size', 'line'], 'lines': [ ['cache-entries', None, 'absolute'], ['packetcache-entries', None, 'absolute'], ['negcache-entries', None, 'absolute'] - ]} + ] + } } diff --git a/python.d/puppet.chart.py b/python.d/puppet.chart.py index 9ac2fddc79..fde8dfdfe4 100644 --- a/python.d/puppet.chart.py +++ b/python.d/puppet.chart.py @@ -2,14 +2,14 @@ # Description: puppet netdata python.d module # Author: Andrey Galkin <andrey@futoin.org> (andvgal) # SPDX-License-Identifier: GPL-3.0+ -#--- +# # This module should work both with OpenSource and PE versions # of PuppetServer and PuppetDB. # # NOTE: PuppetDB may be configured to require proper TLS # client certificate for security reasons. Use tls_key_file # and tls_cert_file options then. -#--- +# from bases.FrameworkServices.UrlService import UrlService from json import loads @@ -30,10 +30,10 @@ ORDER = [ ] CHARTS = { 'jvm_heap': { - 'options': [None, "JVM Heap", "MB", "resources", "puppet.jvm", "area"], + 'options': [None, 'JVM Heap', 'MB', 'resources', 'puppet.jvm', 'area'], 'lines': [ - ["jvm_heap_committed", 'committed', "absolute", 1, MB], - ["jvm_heap_used", 'used', "absolute", 1, MB], + ['jvm_heap_committed', 'committed', 'absolute', 1, MB], + ['jvm_heap_used', 'used', 'absolute', 1, MB], ], 'variables': [ ['jvm_heap_max'], @@ -41,10 +41,10 @@ CHARTS = { ], }, 'jvm_nonheap': { - 'options': [None, "JVM Non-Heap", "MB", "resources", "puppet.jvm", "area"], + 'options': [None, 'JVM Non-Heap', 'MB', 'resources', 'puppet.jvm', 'area'], 'lines': [ - ["jvm_nonheap_committed", 'committed', "absolute", 1, MB], - ["jvm_nonheap_used", 'used', "absolute", 1, MB], + ['jvm_nonheap_committed', 'committed', 'absolute', 1, MB], + ['jvm_nonheap_used', 'used', 'absolute', 1, MB], ], 'variables': [ ['jvm_nonheap_max'], @@ -52,16 +52,16 @@ CHARTS = { ], }, 'cpu': { - 'options': [None, "CPU usage", "percentage", "resources", "puppet.cpu", "stacked"], + 'options': [None, 'CPU usage', 'percentage', 'resources', 'puppet.cpu', 'stacked'], 'lines': [ - ["cpu_time", 'execution', "absolute", 1, CPU_SCALE], - ["gc_time", 'GC', "absolute", 1, CPU_SCALE], + ['cpu_time', 'execution', 'absolute', 1, CPU_SCALE], + ['gc_time', 'GC', 'absolute', 1, CPU_SCALE], ] }, 'fd_open': { - 'options': [None, "File Descriptors", "descriptors", "resources", "puppet.fdopen", "line"], + 'options': [None, 'File Descriptors', 'descriptors', 'resources', 'puppet.fdopen', 'line'], 'lines': [ - ["fd_used", 'used', "absolute"], + ['fd_used', 'used', 'absolute'], ], 'variables': [ ['fd_max'], @@ -69,6 +69,7 @@ CHARTS = { }, } + class Service(UrlService): def __init__(self, configuration=None, name=None): UrlService.__init__(self, configuration=configuration, name=name) @@ -77,7 +78,6 @@ class Service(UrlService): self.definitions = CHARTS def _get_data(self): - #--- # NOTE: there are several ways to retrieve data # 1. Only PE versions: # https://puppet.com/docs/pe/2018.1/api_status/status_api_metrics_endpoints.html @@ -87,7 +87,6 @@ class Service(UrlService): # https://puppet.com/docs/pe/2018.1/api_status/status_api_json_endpoints.html # # For sake of simplicity and efficiency the status one is used.. - #--- raw_data = self._get_raw_data(self.url + '/status/v1/services?level=debug') @@ -119,5 +118,4 @@ class Service(UrlService): except KeyError: pass - return data or None diff --git a/python.d/rabbitmq.chart.py b/python.d/rabbitmq.chart.py index 72a96384b6..eee190b33b 100644 --- a/python.d/rabbitmq.chart.py +++ b/python.d/rabbitmq.chart.py @@ -21,91 +21,104 @@ retries = 60 METHODS = namedtuple('METHODS', ['get_data', 'url', 'stats']) -NODE_STATS = ['fd_used', - 'mem_used', - 'sockets_used', - 'proc_used', - 'disk_free', - 'run_queue' - ] -OVERVIEW_STATS = ['object_totals.channels', - 'object_totals.consumers', - 'object_totals.connections', - 'object_totals.queues', - 'object_totals.exchanges', - 'queue_totals.messages_ready', - 'queue_totals.messages_unacknowledged', - 'message_stats.ack', - 'message_stats.redeliver', - 'message_stats.deliver', - 'message_stats.publish' - ] -ORDER = ['queued_messages', 'message_rates', 'global_counts', - 'file_descriptors', 'socket_descriptors', 'erlang_processes', 'erlang_run_queue', 'memory', 'disk_space'] +NODE_STATS = [ + 'fd_used', + 'mem_used', + 'sockets_used', + 'proc_used', + 'disk_free', + 'run_queue' +] + +OVERVIEW_STATS = [ + 'object_totals.channels', + 'object_totals.consumers', + 'object_totals.connections', + 'object_totals.queues', + 'object_totals.exchanges', + 'queue_totals.messages_ready', + 'queue_totals.messages_unacknowledged', + 'message_stats.ack', + 'message_stats.redeliver', + 'message_stats.deliver', + 'message_stats.publish' +] + +ORDER = [ + 'queued_messages', + 'message_rates', + 'global_counts', + 'file_descriptors', + 'socket_descriptors', + 'erlang_processes', + 'erlang_run_queue', + 'memory', + 'disk_space' +] CHARTS = { 'file_descriptors': { - 'options': [None, 'File Descriptors', 'descriptors', 'overview', - 'rabbitmq.file_descriptors', 'line'], + 'options': [None, 'File Descriptors', 'descriptors', 'overview', 'rabbitmq.file_descriptors', 'line'], 'lines': [ ['fd_used', 'used', 'absolute'] - ]}, + ] + }, 'memory': { - 'options': [None, 'Memory', 'MB', 'overview', - 'rabbitmq.memory', 'line'], + 'options': [None, 'Memory', 'MB', 'overview', 'rabbitmq.memory', 'line'], 'lines': [ ['mem_used', 'used', 'absolute', 1, 1024 << 10] - ]}, + ] + }, 'disk_space': { - 'options': [None, 'Disk Space', 'GB', 'overview', - 'rabbitmq.disk_space', 'line'], + 'options': [None, 'Disk Space', 'GB', 'overview', 'rabbitmq.disk_space', 'line'], 'lines': [ ['disk_free', 'free', 'absolute', 1, 1024 ** 3] - ]}, + ] + }, 'socket_descriptors': { - 'options': [None, 'Socket Descriptors', 'descriptors', 'overview', - 'rabbitmq.sockets', 'line'], + 'options': [None, 'Socket Descriptors', 'descriptors', 'overview', 'rabbitmq.sockets', 'line'], 'lines': [ ['sockets_used', 'used', 'absolute'] - ]}, + ] + }, 'erlang_processes': { - 'options': [None, 'Erlang Processes', 'processes', 'overview', - 'rabbitmq.processes', 'line'], + 'options': [None, 'Erlang Processes', 'processes', 'overview', 'rabbitmq.processes', 'line'], 'lines': [ ['proc_used', 'used', 'absolute'] - ]}, + ] + }, 'erlang_run_queue': { - 'options': [None, 'Erlang Run Queue', 'processes', 'overview', - 'rabbitmq.erlang_run_queue', 'line'], + 'options': [None, 'Erlang Run Queue', 'processes', 'overview', 'rabbitmq.erlang_run_queue', 'line'], 'lines': [ - ['run_queue',' length', 'absolute'] - ]}, + ['run_queue', 'length', 'absolute'] + ] + }, 'global_counts': { - 'options': [None, 'Global Counts', 'counts', 'overview', - 'rabbitmq.global_counts', 'line'], + 'options': [None, 'Global Counts', 'counts', 'overview', 'rabbitmq.global_counts', 'line'], 'lines': [ ['object_totals_channels', 'channels', 'absolute'], ['object_totals_consumers', 'consumers', 'absolute'], ['object_totals_connections', 'connections', 'absolute'], ['object_totals_queues', 'queues', 'absolute'], ['object_totals_exchanges', 'exchanges', 'absolute'] - ]}, + ] + }, 'queued_messages': { - 'options': [None, 'Queued Messages', 'messages', 'overview', - 'rabbitmq.queued_messages', 'stacked'], + 'options': [None, 'Queued Messages', 'messages', 'overview', 'rabbitmq.queued_messages', 'stacked'], 'lines': [ ['queue_totals_messages_ready', 'ready', 'absolute'], ['queue_totals_messages_unacknowledged', 'unacknowledged', 'absolute'] - ]}, + ] + }, 'message_rates': { - 'options': [None, 'Message Rates', 'messages/s', 'overview', - 'rabbitmq.message_rates', 'stacked'], + 'options': [None, 'Message Rates', 'messages/s', 'overview', 'rabbitmq.message_rates', 'stacked'], 'lines': [ ['message_stats_ack', 'ack', 'incremental'], ['message_stats_redeliver', 'redeliver', 'incremental'], ['message_stats_deliver', 'deliver', 'incremental'], ['message_stats_publish', 'publish', 'incremental'] - ]} + ] + } } diff --git a/python.d/redis.chart.py b/python.d/redis.chart.py index fd8dadf373..3a5ae1f247 100644 --- a/python.d/redis.chart.py +++ b/python.d/redis.chart.py @@ -44,29 +44,32 @@ CHARTS = { 'lines': [ ['total_commands_processed', 'commands', 'incremental'], ['instantaneous_ops_per_sec', 'operations', 'absolute'] - ]}, + ] + }, 'hit_rate': { 'options': [None, 'Hit rate', 'percent', 'hits', 'redis.hit_rate', 'line'], 'lines': [ ['hit_rate', 'rate', 'absolute'] - ]}, + ] + }, 'memory': { 'options': [None, 'Memory utilization', 'kilobytes', 'memory', 'redis.memory', 'line'], 'lines': [ ['used_memory', 'total', 'absolute', 1, 1024], ['used_memory_lua', 'lua', 'absolute', 1, 1024] - ]}, + ] + }, 'net': { 'options': [None, 'Bandwidth', 'kilobits/s', 'network', 'redis.net', 'area'], 'lines': [ ['total_net_input_bytes', 'in', 'incremental', 8, 1024], ['total_net_output_bytes', 'out', 'incremental', -8, 1024] - ]}, + ] + }, 'keys_redis': { 'options': [None, 'Keys per Database', 'keys', 'keys', 'redis.keys', 'line'], - 'lines': [ - # lines are created dynamically in `check()` method - ]}, + 'lines': [] + }, 'keys_pika': { 'options': [None, 'Keys', 'keys', 'keys', 'redis.keys', 'line'], 'lines': [ @@ -75,52 +78,61 @@ CHARTS = { ['list_keys', 'list', 'absolute'], ['zset_keys', 'zset', 'absolute'], ['set_keys', 'set', 'absolute'] - ]}, + ] + }, 'eviction': { 'options': [None, 'Evicted Keys', 'keys', 'keys', 'redis.eviction', 'line'], 'lines': [ ['evicted_keys', 'evicted', 'absolute'] - ]}, + ] + }, 'connections': { 'options': [None, 'Connections', 'connections/s', 'connections', 'redis.connections', 'line'], 'lines': [ ['total_connections_received', 'received', 'incremental', 1], ['rejected_connections', 'rejected', 'incremental', -1] - ]}, + ] + }, 'clients': { 'options': [None, 'Clients', 'clients', 'connections', 'redis.clients', 'line'], 'lines': [ ['connected_clients', 'connected', 'absolute', 1], ['blocked_clients', 'blocked', 'absolute', -1] - ]}, + ] + }, 'slaves': { 'options': [None, 'Slaves', 'slaves', 'replication', 'redis.slaves', 'line'], 'lines': [ ['connected_slaves', 'connected', 'absolute'] - ]}, + ] + }, 'persistence': { 'options': [None, 'Persistence Changes Since Last Save', 'changes', 'persistence', 'redis.rdb_changes', 'line'], 'lines': [ ['rdb_changes_since_last_save', 'changes', 'absolute'] - ]}, + ] + }, 'bgsave_now': { 'options': [None, 'Duration of the RDB Save Operation', 'seconds', 'persistence', 'redis.bgsave_now', 'absolute'], 'lines': [ ['rdb_bgsave_in_progress', 'rdb save', 'absolute'] - ]}, + ] + }, 'bgsave_health': { 'options': [None, 'Status of the Last RDB Save Operation', 'status', 'persistence', 'redis.bgsave_health', 'line'], 'lines': [ ['rdb_last_bgsave_status', 'rdb save', 'absolute'] - ]}, + ] + }, 'uptime': { 'options': [None, 'Uptime', 'seconds', 'uptime', 'redis.uptime', 'line'], 'lines': [ ['uptime_in_seconds', 'uptime', 'absolute'] - ]} + ] + } } @@ -153,7 +165,7 @@ class Service(SocketService): if not resp: return False if resp.strip() != '+OK': - self.error("invalid password") + self.error('invalid password') return False return True @@ -169,7 +181,7 @@ class Service(SocketService): parsed = RE.findall(resp) if not parsed: - self.error("response is invalid/empty") + self.error('response is invalid/empty') return None return dict((k.replace(' ', '_'), v) for k, v in parsed) @@ -215,12 +227,12 @@ class Service(SocketService): if not data: return False - self.order = PIKA_ORDER if data.get("pika_version") else REDIS_ORDER + self.order = PIKA_ORDER if data.get('pika_version') else REDIS_ORDER for n in self.order: self.definitions.update(copy_chart(n)) - if data.get("redis_version"): + if data.get('redis_version'): for k in data: if k.startswith('db'): self.definitions['keys_redis']['lines'].append([k, None, 'absolute']) @@ -242,8 +254,8 @@ class Service(SocketService): supposed = int(supposed) if length - offset >= supposed: - self.debug("received full response from redis") + self.debug('received full response from redis') return True - self.debug("waiting more data from redis") + self.debug('waiting more data from redis') return False diff --git a/python.d/rethinkdbs.chart.py b/python.d/rethinkdbs.chart.py index a5f825ae1b..2460416acd 100644 --- a/python.d/rethinkdbs.chart.py +++ b/python.d/rethinkdbs.chart.py @@ -34,21 +34,21 @@ def cluster_charts(): 'line'], 'lines': [ ['cluster_clients_active', 'active'], - ] - }, + ] + }, 'cluster_queries': { 'options': [None, 'Queries', 'queries/s', 'cluster', 'rethinkdb.cluster_queries', 'line'], 'lines': [ ['cluster_queries_per_sec', 'queries'], - ] - }, + ] + }, 'cluster_documents': { 'options': [None, 'Documents', 'documents/s', 'cluster', 'rethinkdb.cluster_documents', 'line'], 'lines': [ ['cluster_read_docs_per_sec', 'reads'], ['cluster_written_docs_per_sec', 'writes'], - ] - }, + ] + }, } @@ -126,7 +126,7 @@ class Server: 'queries_total': qe['queries_total'], 'read_docs_total': qe['read_docs_total'], 'written_docs_total': qe['written_docs_total'], - } + } return dict(('{0}_{1}'.format(self.name, k), d[k]) for k in d) diff --git a/python.d/retroshare.chart.py b/python.d/retroshare.chart.py index e706c9b6b3..257e9a0d96 100644 --- a/python.d/retroshare.chart.py +++ b/python.d/retroshare.chart.py @@ -21,19 +21,22 @@ CHARTS = { 'lines': [ ['bandwidth_up_kb', 'Upload'], ['bandwidth_down_kb', 'Download'] - ]}, + ] + }, 'peers': { 'options': [None, 'RetroShare Peers', 'peers', 'RetroShare', 'retroshare.peers', 'line'], 'lines': [ ['peers_all', 'All friends'], ['peers_connected', 'Connected friends'] - ]}, + ] + }, 'dht': { 'options': [None, 'Retroshare DHT', 'peers', 'RetroShare', 'retroshare.dht', 'line'], 'lines': [ ['dht_size_all', 'DHT nodes estimated'], ['dht_size_rs', 'RS nodes estimated'] - ]} + ] + } } |