]> arthur.barton.de Git - netdata.git/commitdiff
raw data validator + incremental network graph
authorpaulfantom <paulfantom@gmail.com>
Wed, 3 Aug 2016 15:53:31 +0000 (17:53 +0200)
committerpaulfantom <paulfantom@gmail.com>
Wed, 3 Aug 2016 15:53:31 +0000 (17:53 +0200)
python.d/memcached.chart.py

index 12e0fb9b57d645ba560409508381987eadc0a21e..1c0e54e86ba2fcf2b2f03df782ab312ca4bfd097 100644 (file)
@@ -23,10 +23,10 @@ ORDER = ['net', 'connections', 'items', 'evicted_reclaimed', 'get', 'get_rate',
 
 CHARTS = {
     'net': {
-        'options': [None, 'Network', 'bytes', 'Network', 'memcached.net', 'line'],
+        'options': [None, 'Network', 'kilobytes/s', 'Network', 'memcached.net', 'line'],
         'lines': [
-            ['bytes_read', 'read', 'absolute'],
-            ['bytes_written', 'written', 'absolute']
+            ['bytes_read', 'read', 'incremental', 1, 1024],
+            ['bytes_written', 'written', 'incremental', 1, 1024]
         ]},
     'connections': {
         'options': [None, 'Connections', 'connections', 'Cluster', 'memcached.cluster', 'line'],
@@ -108,6 +108,7 @@ class Service(SocketService):
         self.request = "stats\r\n"
         self.host = "localhost"
         self.port = 11211
+        self._keep_alive = True
         self.unix_socket = None
         self.order = ORDER
         self.definitions = CHARTS
@@ -144,6 +145,12 @@ class Service(SocketService):
         else:
             return data
 
+    def _check_raw_data(self, data):
+        if data.endswith('END\r\n'):
+            return True
+        else:
+            return False
+
     def check(self):
         """
         Parse configuration, check if memcached is available