mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
21 lines
658 B
Python
21 lines
658 B
Python
![]() |
#!/usr/bin/env python
|
||
|
import datetime
|
||
|
from utils.munin.base import MuninGraph
|
||
|
from apps.rss_feeds.models import Feed
|
||
|
|
||
|
graph_config = {
|
||
|
'graph_category' : 'NewsBlur',
|
||
|
'graph_title' : 'NewsBlur Updates',
|
||
|
'graph_vlabel' : '# of updates',
|
||
|
'update_queue.label': 'Queued Feeds',
|
||
|
'feeds_fetched.label': 'Fetched feeds last hour',
|
||
|
}
|
||
|
|
||
|
metrics = {
|
||
|
'update_queue': Feed.objects.filter(next_scheduled_update__lte=datetime.datetime.now(), active=True).count(),
|
||
|
'feeds_fetched': Feed.objects.filter(last_update__gte=datetime.datetime.now()-datetime.timedelta(hours=1))
|
||
|
}
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
MuninGraph(graph_config, metrics).run()
|