raw data validator + incremental network graph
paulfantom committed
Aug 3, 2016 at 17:53 UTC
192ed13eed61ea566d45279010d579f7f5e1bc0a
1 file changed
+10
-3
python.d/memcached.chart.py
+10
-3
@@ -23,10 +23,10 @@ ORDER = ['net', 'connections', 'items', 'evicted_reclaimed', 'get', 'get_rate',
23
24
CHARTS = {
25
'net': {
26
- 'options': [None, 'Network', 'bytes', 'Network', 'memcached.net', 'line'],
26
+ 'options': [None, 'Network', 'kilobytes/s', 'Network', 'memcached.net', 'line'],
27
'lines': [
28
- ['bytes_read', 'read', 'absolute'],
29
- ['bytes_written', 'written', 'absolute']
28
+ ['bytes_read', 'read', 'incremental', 1, 1024],
29
+ ['bytes_written', 'written', 'incremental', 1, 1024]
30
]},
31
'connections': {
32
'options': [None, 'Connections', 'connections', 'Cluster', 'memcached.cluster', 'line'],
@@ -108,6 +108,7 @@ class Service(SocketService):
108
self.request = "stats\r\n"
109
self.host = "localhost"
110
self.port = 11211
111
+ self._keep_alive = True
112
self.unix_socket = None
113
self.order = ORDER
114
self.definitions = CHARTS
@@ -144,6 +145,12 @@ class Service(SocketService):
145
else:
146
return data
147
148
+ def _check_raw_data(self, data):
149
+ if data.endswith('END\r\n'):
150
+ return True
151
+ else:
152
+ return False
153
+
154
def check(self):
155
"""
156
Parse configuration, check if memcached is available