2010-07-21 12:49:33 -04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
from utils.munin.base import MuninGraph
|
|
|
|
|
|
|
|
graph_config = {
|
|
|
|
'graph_category' : 'NewsBlur',
|
2010-08-30 22:58:41 -04:00
|
|
|
'graph_title' : 'NewsBlur Fetching History',
|
2010-07-21 13:02:43 -04:00
|
|
|
'graph_vlabel' : 'errors',
|
2011-11-03 09:19:24 -07:00
|
|
|
# 'feed_errors.label': 'Feed Errors',
|
2010-07-21 13:02:43 -04:00
|
|
|
'feed_success.label': 'Feed Success',
|
2011-11-03 09:19:24 -07:00
|
|
|
# 'page_errors.label': 'Page Errors',
|
2010-07-21 13:02:43 -04:00
|
|
|
'page_success.label': 'Page Success',
|
2010-07-21 12:49:33 -04:00
|
|
|
}
|
|
|
|
|
2011-03-23 15:43:15 -04:00
|
|
|
def calculate_metrics():
|
2011-11-01 19:04:34 -07:00
|
|
|
from apps.statistics.models import MStatistics
|
|
|
|
statistics = MStatistics.all()
|
2011-03-23 15:43:15 -04:00
|
|
|
|
|
|
|
return {
|
2011-11-02 09:43:20 -07:00
|
|
|
'feed_success': statistics['feeds_fetched'],
|
|
|
|
'page_success': statistics['pages_fetched'],
|
2011-03-23 15:43:15 -04:00
|
|
|
}
|
2010-07-21 12:49:33 -04:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2011-03-23 15:43:15 -04:00
|
|
|
MuninGraph(graph_config, calculate_metrics).run()
|