add other counter
paulfantom committed
Jul 2, 2016 at 18:58 UTC
8821f37e3cb718f9cb2e4dcc2535dbee6a4a1788
1 file changed
+7
-2
python.d/apache_cache.chart.py
+7
-2
@@ -14,7 +14,8 @@ CHARTS = {
14
'options': [None, 'apache cached responses', 'percent cached', 'cached', 'apache_cache.cache', 'stacked'],
15
'lines': [
16
["hit", 'cache', "percentage-of-absolute-row"],
17
- ["miss", None, "percentage-of-absolute-row"]
17
+ ["miss", None, "percentage-of-absolute-row"],
18
+ ["other", None, "percentage-of-absolute-row"]
19
]}
20
}
21
@@ -41,11 +42,15 @@ class Service(LogService):
42
43
hit = 0
44
miss = 0
45
+ other = 0
46
for line in raw:
47
if "cache hit" in line:
48
hit += 1
49
elif "cache miss" in line:
50
miss += 1
51
+ else:
52
+ other += 1
53
54
return {'hit': hit,
51
- 'miss': miss}
55
+ 'miss': miss,
56
+ 'other': other}