Permalink
Browse files

Add reporting of logging volume to Smolt.

This reports the logging volume as a percentage of the total amount
stored in the database, for each urgency level. This is intended as a
simple metric to determine stability of MythTV, as higher counts of
higher urgency levels will indicate an increase in problems seen by the
user base.
  • Loading branch information...
1 parent fc82ee5 commit 5f90b1d62c4d692a6c23ae22ab2047db85e6572e @wagnerrp wagnerrp committed Oct 10, 2012
Showing with 16 additions and 4 deletions.
  1. +16 −4 mythtv/programs/scripts/hardwareprofile/distros/mythtv_data/data_mythtv.py
@@ -453,9 +453,20 @@ def ProcessSmoltInfo(self):
return myth_systemrole , mythremote
-
-
-
+ def ProcessLogUrgency(self):
+ c = _DB.cursor()
+ c.execute("""SELECT level,count(level) FROM logging GROUP BY level""")
+ levels = ('EMERG', 'ALERT', 'CRIT', 'ERR',
+ 'WARNING', 'NOTICE', 'INFO') # ignore debugging from totals
+ counts = {}
+ total = 0.
+ for level,count in c.fetchall():
+ if level in range(len(levels)):
+ counts[levels[level]] = count
+ total += count
+ for k,v in counts.items():
+ counts[k] = v/total
+ return {'logurgency':counts}
def get_data(self,gate):
self._data = OrdDict()
@@ -469,7 +480,8 @@ def get_data(self,gate):
self.ProcessVideoProfile,
self.ProcessMySQL,
self.ProcessScheduler,
- self.Processtuners):
+ self.Processtuners,
+ self.ProcessLogUrgency):
try:
self._data.update(func())
except:

0 comments on commit 5f90b1d

Please sign in to comment.