@cryptotaxi247 / netdata-1 / commits / 8e504121c

change memcached cache chart to stacked type

paulfantom committed Aug 24, 2016 at 19:11 UTC 8e504121c769c55df48889ff3667e3417c29ba24
1 file changed +8 -3
python.d/memcached.chart.py
+8 -3
@@ -24,10 +24,10 @@ ORDER = ['cache', 'net', 'connections', 'items', 'evicted_reclaimed',
24
25 CHARTS = {
26 'cache': {
27 - 'options': [None, 'Cache Size', 'kilobytes', 'Cache', 'memcached.cache', 'line'],
27 + 'options': [None, 'Cache Size', 'kilobytes', 'Cache', 'memcached.cache', 'stacked'],
28 'lines': [
29 - ['bytes', 'used', 'absolute', 1, 1024],
30 - ['limit_maxbytes', 'total', 'absolute', 1, 1024]
29 + ['bytes', 'used', 'absolute', 1, 1048576],
30 + ['available', 'available', 'absolute', 1, 1048576]
31 ]},
32 'net': {
33 'options': [None, 'Network', 'kilobytes/s', 'Network', 'memcached.net', 'line'],
@@ -146,6 +146,11 @@ class Service(SocketService):
146 except:
147 data['hit_rate'] = 0
148
149 + try:
150 + data['available'] = int(data['limit_maxbytes']) - int(data['bytes'])
151 + except:
152 + pass
153 +
154 if len(data) == 0:
155 self.error("received data doesn't have needed records")
156 return None