Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 5f90b1d62c4d692a6c23ae22ab2047db85e6572e 1 parent fc82ee5
@wagnerrp wagnerrp authored
View
20 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:
Please sign in to comment.
Something went wrong with that request. Please try again.