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.

(cherry picked from commit 5f90b1d)
  • Loading branch information...
1 parent 3800761 commit 84431ca786a4543623fb3a293b0ec18d49194338 @wagnerrp wagnerrp committed Oct 10, 2012
Showing with 15 additions and 1 deletion.
  1. +15 −1 mythtv/programs/scripts/hardwareprofile/distros/mythtv_data/data_mythtv.py
@@ -453,7 +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}
@@ -470,6 +483,7 @@ def get_data(self,gate):
self._data.update(self.ProcessMySQL())
self._data.update(self.ProcessScheduler())
self._data.update(self.Processtuners())
+ self._data.update(self.ProcessLogUrgency())
self._data.theme = _SETTINGS.Theme
self._data.country = _SETTINGS.Country

0 comments on commit 84431ca

Please sign in to comment.