2016-11-20 11:05:14 -08:00
|
|
|
#!/srv/newsblur/venv/newsblur/bin/python
|
2010-06-08 11:19:41 -04:00
|
|
|
from utils.munin.base import MuninGraph
|
|
|
|
|
|
|
|
|
2012-09-27 10:45:40 -07:00
|
|
|
class NBMuninGraph(MuninGraph):
|
2011-03-23 15:43:15 -04:00
|
|
|
|
2012-09-27 10:45:40 -07:00
|
|
|
@property
|
|
|
|
def graph_config(self):
|
|
|
|
return {
|
|
|
|
'graph_category' : 'NewsBlur',
|
|
|
|
'graph_title' : 'NewsBlur Stories',
|
|
|
|
'graph_vlabel' : 'Stories',
|
2012-09-28 09:50:12 -07:00
|
|
|
'graph_args' : '-l 0',
|
2013-07-11 15:55:37 -07:00
|
|
|
'stories.label': 'Stories',
|
|
|
|
'starred_stories.label': 'Starred stories',
|
2012-09-27 10:45:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
def calculate_metrics(self):
|
2013-07-11 15:55:37 -07:00
|
|
|
from apps.rss_feeds.models import MStory, MStarredStory
|
2012-09-27 10:45:40 -07:00
|
|
|
|
|
|
|
return {
|
2013-07-11 15:55:37 -07:00
|
|
|
'stories': MStory.objects.count(),
|
|
|
|
'starred_stories': MStarredStory.objects.count(),
|
2012-09-27 10:45:40 -07:00
|
|
|
}
|
2010-06-08 11:19:41 -04:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2012-09-27 10:45:40 -07:00
|
|
|
NBMuninGraph().run()
|