summaryrefslogtreecommitdiffstats
path: root/python.d/memcached.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/memcached.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/memcached.chart.py')
-rw-r--r--python.d/memcached.chart.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/python.d/memcached.chart.py b/python.d/memcached.chart.py
index 0d6807ba7..4f7adfa23 100644
--- a/python.d/memcached.chart.py
+++ b/python.d/memcached.chart.py
@@ -2,7 +2,7 @@
# Description: memcached netdata python.d module
# Author: Pawel Krupa (paulfantom)
-from base import SocketService
+from bases.FrameworkServices.SocketService import SocketService
# default module values (can be overridden per job in `config`)
#update_every = 2
@@ -149,9 +149,8 @@ class Service(SocketService):
data[t[0]] = t[1]
except (IndexError, ValueError):
self.debug("invalid line received: " + str(line))
- pass
- if len(data) == 0:
+ if not data:
self.error("received data doesn't have any records")
return None
@@ -159,7 +158,7 @@ class Service(SocketService):
try:
data['avail'] = int(data['limit_maxbytes']) - int(data['bytes'])
data['used'] = int(data['bytes'])
- except:
+ except (KeyError, ValueError, TypeError):
pass
return data
@@ -178,11 +177,7 @@ class Service(SocketService):
:return: boolean
"""
self._parse_config()
- if self.name == "":
- self.name = "local"
- self.chart_name += "_" + self.name
data = self._get_data()
if data is None:
return False
-
return True