2010-06-08 11:19:41 -04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
from utils.munin.base import MuninGraph
|
|
|
|
|
2012-09-27 10:45:40 -07:00
|
|
|
class NBMuninGraph(MuninGraph):
|
2010-06-08 11:19:41 -04:00
|
|
|
|
2012-09-27 10:45:40 -07:00
|
|
|
@property
|
|
|
|
def graph_config(self):
|
|
|
|
return {
|
|
|
|
'graph_category' : 'NewsBlur',
|
|
|
|
'graph_title' : 'NewsBlur Feeds & Subscriptions',
|
|
|
|
'graph_vlabel' : 'Feeds & Subscribers',
|
2012-09-28 09:50:12 -07:00
|
|
|
'graph_args' : '-l 0',
|
2012-09-27 10:45:40 -07:00
|
|
|
'feeds.label': 'feeds',
|
|
|
|
'subscriptions.label': 'subscriptions',
|
|
|
|
'profiles.label': 'profiles',
|
|
|
|
'social_subscriptions.label': 'social_subscriptions',
|
|
|
|
}
|
|
|
|
|
|
|
|
def calculate_metrics(self):
|
|
|
|
from apps.rss_feeds.models import Feed
|
|
|
|
from apps.reader.models import UserSubscription
|
|
|
|
from apps.social.models import MSocialProfile, MSocialSubscription
|
|
|
|
return {
|
2013-06-26 13:03:44 -07:00
|
|
|
'feeds': Feed.objects.latest('pk').pk,
|
|
|
|
'subscriptions': UserSubscription.objects.latest('pk').pk,
|
2012-09-27 10:45:40 -07:00
|
|
|
'profiles': MSocialProfile.objects.count(),
|
|
|
|
'social_subscriptions': MSocialSubscription.objects.count(),
|
|
|
|
}
|
2010-06-08 11:19:41 -04:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2012-09-27 10:45:40 -07:00
|
|
|
NBMuninGraph().run()
|