]> arthur.barton.de Git - netdata.git/commitdiff
change memcached cache chart to stacked type
authorpaulfantom <paulfantom@gmail.com>
Wed, 24 Aug 2016 17:11:15 +0000 (19:11 +0200)
committerpaulfantom <paulfantom@gmail.com>
Wed, 24 Aug 2016 17:11:15 +0000 (19:11 +0200)
python.d/memcached.chart.py

index c680128aa1768cfb4cfc984a0bc9d55b0c9ed351..17cab593337f6046c9429bc9e72de352e955416f 100644 (file)
@@ -24,10 +24,10 @@ ORDER = ['cache', 'net', 'connections', 'items', 'evicted_reclaimed',
 
 CHARTS = {
     'cache': {
-        'options': [None, 'Cache Size', 'kilobytes', 'Cache', 'memcached.cache', 'line'],
+        'options': [None, 'Cache Size', 'kilobytes', 'Cache', 'memcached.cache', 'stacked'],
         'lines': [
-            ['bytes', 'used', 'absolute', 1, 1024],
-            ['limit_maxbytes', 'total', 'absolute', 1, 1024]
+            ['bytes', 'used', 'absolute', 1, 1048576],
+            ['available', 'available', 'absolute', 1, 1048576]
         ]},
     'net': {
         'options': [None, 'Network', 'kilobytes/s', 'Network', 'memcached.net', 'line'],
@@ -146,6 +146,11 @@ class Service(SocketService):
         except:
             data['hit_rate'] = 0
 
+        try:
+            data['available'] = int(data['limit_maxbytes']) - int(data['bytes'])
+        except:
+            pass
+
         if len(data) == 0:
             self.error("received data doesn't have needed records")
             return None