2016-11-20 11:05:14 -08:00
|
|
|
#!/srv/newsblur/venv/newsblur/bin/python
|
2010-09-23 10:29:18 -04:00
|
|
|
from utils.munin.base import MuninGraph
|
|
|
|
|
2012-09-27 10:45:40 -07:00
|
|
|
class NBMuninGraph(MuninGraph):
|
2010-09-23 10:29:18 -04:00
|
|
|
|
2012-09-27 10:45:40 -07:00
|
|
|
@property
|
|
|
|
def graph_config(self):
|
|
|
|
return {
|
|
|
|
'graph_category' : 'NewsBlur',
|
|
|
|
'graph_title' : 'NewsBlur Loadtimes',
|
|
|
|
'graph_vlabel' : 'Loadtimes (seconds)',
|
2012-09-28 09:50:12 -07:00
|
|
|
'graph_args' : '-l 0',
|
2012-09-27 10:45:40 -07:00
|
|
|
'feed_loadtimes_avg_hour.label': 'Feed Loadtimes Avg (Hour)',
|
|
|
|
'feeds_loaded_hour.label': 'Feeds Loaded (Hour)',
|
|
|
|
}
|
|
|
|
|
|
|
|
def calculate_metrics(self):
|
2013-03-29 13:14:19 -07:00
|
|
|
from apps.statistics.models import MStatistics
|
2012-09-27 15:21:38 -07:00
|
|
|
|
2012-09-27 10:45:40 -07:00
|
|
|
return {
|
2013-03-29 13:14:19 -07:00
|
|
|
'feed_loadtimes_avg_hour': MStatistics.get('latest_avg_time_taken'),
|
|
|
|
'feeds_loaded_hour': MStatistics.get('latest_sites_loaded'),
|
2012-09-27 10:45:40 -07:00
|
|
|
}
|
2010-09-23 10:29:18 -04:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2012-09-27 10:45:40 -07:00
|
|
|
NBMuninGraph().run()
|