Commits

Benoc Linden  committed e2d192b

re-engineer calculation of "# recursions". Fixed some typo, removed spurious runningcount.

  • Participants
  • Parent commits cfefd22

Comments (0)

Files changed (1)

File src/UnboundLogtailer.py

 
 import time
 import threading
+import re
 
 # local dependencies
 from ganglia_logtailer_helper import GangliaMetricObject
         self.queries = [0,0,0,0]
         self.caches = [0,0,0,0]
         self.recursions = [0,0,0,0]
-
     # example function for parse line
     # takes one argument (text) line to be parsed
     # returns nothing
         if regMatch:
             self.num_lines+=1
             bitsdict = regMatch.groupdict()
+		
             self.queries[int(bitsdict['thread'])] += int(bitsdict['queries'])
             self.caches[int(bitsdict['thread'])] += int(bitsdict['caches'])
-            self.recursions[int(bitsdict['thread'])] += int(bitsdict['recursions'])
-            self.runningcount[bitsdict['time']][int(bitsdict['thread'])] = bitsdict['queries'], bitsdict['caches'], bitsdict['recursions']
+            self.recursions[int(bitsdict['thread'])] += int(bitsdict['queries']) - int(bitsdict['caches'])
         self.lock.release()
     # example function for deep copy
     # takes no arguments
         caches_per_second = sum(caches) / check_time
 
         # package up the data you want to submit
-        qps_metric = GangliaMetricObject('queries', queries_per_second, units='qps')
-        rps_metric = GangliaMetricObject('recursions', recursions_per_second, units='rps')
-        cps_metric = GangliaMetricObject('caches', caches_per_second, units='cps')
+        qps_metric = GangliaMetricObject('unbound_queries', queries_per_second, units='qps')
+        rps_metric = GangliaMetricObject('unbound_recursions', recursions_per_second, units='rps')
+        cps_metric = GangliaMetricObject('unbound_cachehits', caches_per_second, units='cps')
         # return a list of metric objects
-        return [ lps_metric, rps_metric, cps_metric ]
+        return [ qps_metric, rps_metric, cps_metric ]