]> arthur.barton.de Git - netdata.git/commitdiff
hit and miss values
authorpaulfantom <paulfantom@gmail.com>
Fri, 1 Jul 2016 16:06:57 +0000 (18:06 +0200)
committerpaulfantom <paulfantom@gmail.com>
Fri, 1 Jul 2016 16:06:57 +0000 (18:06 +0200)
python.d/apache_cache.chart.py

index 16d056b97656a8129beb11edf607e8cef03b70b2..115414abaa075f8716646610035364bde255dbcb 100644 (file)
@@ -41,7 +41,6 @@ class Service(LogService):
 
         hit = 0
         miss = 0
-
         for line in raw:
             if "cache hit" in line:
                 hit += 1
@@ -52,6 +51,5 @@ class Service(LogService):
         if total == 0:
             return None
 
-        hit_percent = int(hit/float(total) * 100)
-        return {'hit': hit_percent,
-                'miss': 100 - hit_percent}
+        return {'hit': int(hit/float(total) * 100),
+                'miss': int(miss/float(total) * 100)}