2010-06-08 11:19:41 -04:00
|
|
|
#!/usr/bin/env python
|
2010-08-11 20:47:08 -04:00
|
|
|
import datetime
|
2010-06-08 11:19:41 -04:00
|
|
|
from utils.munin.base import MuninGraph
|
|
|
|
from apps.rss_feeds.models import Feed
|
|
|
|
from apps.reader.models import UserSubscription
|
|
|
|
|
|
|
|
graph_config = {
|
|
|
|
'graph_category' : 'NewsBlur',
|
|
|
|
'graph_title' : 'NewsBlur Feeds',
|
|
|
|
'graph_vlabel' : 'Feeds & Subscribers',
|
|
|
|
'feeds.label': 'feeds',
|
|
|
|
'subscriptions.label': 'subscriptions',
|
2010-08-11 20:47:08 -04:00
|
|
|
'update_queue.label': 'update_queue',
|
2010-06-08 11:19:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
metrics = {
|
|
|
|
'feeds': Feed.objects.count(),
|
|
|
|
'subscriptions': UserSubscription.objects.count(),
|
2010-08-11 20:47:08 -04:00
|
|
|
'update_queue': Feed.objects.filter(next_scheduled_update__lte=datetime.datetime.now()).count(),
|
2010-06-08 11:19:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
MuninGraph(graph_config, metrics).run()
|