NewsBlur/apps/monitor/views/newsblur_dbtimes.py

19 lines
611 B
Python
Raw Normal View History

from django.http import JsonResponse
from django.views import View
from apps.statistics.models import MStatistics
class DbTimes(View):
def get(self, request):
return JsonResponse({
'sql_avg': MStatistics.get('latest_sql_avg'),
'mongo_avg': MStatistics.get('latest_mongo_avg'),
'redis_avg': MStatistics.get('latest_redis_avg'),
'task_sql_avg': MStatistics.get('latest_task_sql_avg'),
'task_mongo_avg': MStatistics.get('latest_task_mongo_avg'),
'task_redis_avg': MStatistics.get('latest_task_redis_avg'),
})