mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-05 16:49:45 +00:00
31 lines
1.1 KiB
Python
Executable file
31 lines
1.1 KiB
Python
Executable file
#!/usr/bin/env python
|
|
from utils.munin.base import MuninGraph
|
|
|
|
class NBMuninGraph(MuninGraph):
|
|
|
|
@property
|
|
def graph_config(self):
|
|
return {
|
|
'graph_category' : 'NewsBlur',
|
|
'graph_title' : 'NewsBlur Feeds & Subscriptions',
|
|
'graph_vlabel' : 'Feeds & Subscribers',
|
|
'graph_args' : '-l 0',
|
|
'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 {
|
|
'feeds': Feed.objects.latest('pk').pk,
|
|
'subscriptions': UserSubscription.objects.latest('pk').pk,
|
|
'profiles': MSocialProfile.objects.count(),
|
|
'social_subscriptions': MSocialSubscription.objects.count(),
|
|
}
|
|
|
|
if __name__ == '__main__':
|
|
NBMuninGraph().run()
|