NewsBlur/utils/munin/newsblur_feeds.py

27 lines
892 B
Python
Raw Normal View History

2010-06-08 11:19:41 -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 Feeds & Subscriptions',
2010-06-08 11:19:41 -04:00
'graph_vlabel' : 'Feeds & Subscribers',
'feeds.label': 'feeds',
'subscriptions.label': 'subscriptions',
'profiles.label': 'profiles',
'social_subscriptions.label': 'social_subscriptions',
2010-06-08 11:19:41 -04:00
}
def calculate_metrics():
from apps.rss_feeds.models import Feed
from apps.reader.models import UserSubscription
2012-07-29 23:24:26 -07:00
from apps.social.models import MSocialProfile, MSocialSubscription
return {
'feeds': Feed.objects.count(),
'subscriptions': UserSubscription.objects.count(),
2012-07-29 23:24:26 -07:00
'profiles': MSocialProfile.objects.count(),
'social_subscriptions': MSocialSubscription.objects.count(),
}
2010-06-08 11:19:41 -04:00
if __name__ == '__main__':
MuninGraph(graph_config, calculate_metrics).run()