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/varnish/varnish.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/varnish/varnish.chart.py (renamed from python.d/varnish.chart.py) | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/python.d/varnish.chart.py b/collectors/python.d.plugin/varnish/varnish.chart.py index d8145c0b6..d889c2b33 100644 --- a/python.d/varnish.chart.py +++ b/collectors/python.d.plugin/varnish/varnish.chart.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Description: varnish netdata python.d module # Author: l2isbad +# SPDX-License-Identifier: GPL-3.0-or-later import re @@ -12,13 +13,22 @@ from bases.FrameworkServices.ExecutableService import ExecutableService priority = 60000 retries = 60 -ORDER = ['session_connections', 'client_requests', - 'all_time_hit_rate', 'current_poll_hit_rate', 'cached_objects_expired', 'cached_objects_nuked', - 'threads_total', 'threads_statistics', 'threads_queue_len', - 'backend_connections', 'backend_requests', - 'esi_statistics', - 'memory_usage', - 'uptime'] +ORDER = [ + 'session_connections', + 'client_requests', + 'all_time_hit_rate', + 'current_poll_hit_rate', + 'cached_objects_expired', + 'cached_objects_nuked', + 'threads_total', + 'threads_statistics', + 'threads_queue_len', + 'backend_connections', + 'backend_requests', + 'esi_statistics', + 'memory_usage', + 'uptime' +] CHARTS = { 'session_connections': { @@ -213,8 +223,9 @@ class Service(ExecutableService): data.update(dict((param, value) for _, param, value in server_stats)) - data['memory_allocated'] = data['s0.g_bytes'] - data['memory_free'] = data['s0.g_space'] + # varnish 5 uses default.g_bytes and default.g_space + data['memory_allocated'] = data.get('s0.g_bytes') or data.get('default.g_bytes') + data['memory_free'] = data.get('s0.g_space') or data.get('default.g_space') return data |