2010-06-08 11:19:41 -04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
from utils.munin.base import MuninGraph
|
2010-10-12 13:17:43 -04:00
|
|
|
from apps.rss_feeds.models import Feed, DuplicateFeed
|
2010-06-08 11:19:41 -04:00
|
|
|
from apps.reader.models import UserSubscription
|
|
|
|
|
|
|
|
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',
|
2010-08-25 21:02:21 -04:00
|
|
|
'exception_feeds.label': 'exception_feeds',
|
2010-09-08 13:58:05 -07:00
|
|
|
'inactive_feeds.label': 'inactive_feeds',
|
2010-10-12 13:17:43 -04:00
|
|
|
'duplicate_feeds.label': 'duplicate_feeds',
|
2010-10-15 15:40:38 -04:00
|
|
|
'active_feeds.label': 'active_feeds',
|
2010-06-08 11:19:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
metrics = {
|
|
|
|
'feeds': Feed.objects.count(),
|
|
|
|
'subscriptions': UserSubscription.objects.count(),
|
2010-11-10 18:41:57 -05:00
|
|
|
'exception_feeds': Feed.objects.filter(has_exception=True).count(),
|
2010-09-08 13:58:05 -07:00
|
|
|
'inactive_feeds': Feed.objects.filter(active=False).count(),
|
2010-10-12 13:17:43 -04:00
|
|
|
'duplicate_feeds': DuplicateFeed.objects.count(),
|
2010-10-15 19:46:49 +00:00
|
|
|
'active_feeds': Feed.objects.filter(active_subscribers__gt=0).count(),
|
2010-06-08 11:19:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
MuninGraph(graph_config, metrics).run()
|