mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
26 lines
762 B
Python
Executable file
26 lines
762 B
Python
Executable file
#!/usr/bin/env python
|
|
|
|
from utils.munin.base import MuninGraph
|
|
|
|
graph_config = {
|
|
'graph_category' : 'NewsBlur',
|
|
'graph_title' : 'NewsBlur Classifiers',
|
|
'graph_vlabel' : '# of classifiers',
|
|
'feeds.label': 'feeds',
|
|
'authors.label': 'authors',
|
|
'tags.label': 'tags',
|
|
'titles.label': 'titles',
|
|
}
|
|
|
|
def calculate_metrics():
|
|
from apps.analyzer.models import MClassifierFeed, MClassifierAuthor, MClassifierTag, MClassifierTitle
|
|
|
|
return {
|
|
'feeds': MClassifierFeed.objects.count(),
|
|
'authors': MClassifierAuthor.objects.count(),
|
|
'tags': MClassifierTag.objects.count(),
|
|
'titles': MClassifierTitle.objects.count(),
|
|
}
|
|
|
|
if __name__ == '__main__':
|
|
MuninGraph(graph_config, calculate_metrics).run()
|