2021-04-27 07:56:02 -05:00
|
|
|
from django.shortcuts import render
|
2021-03-26 13:28:03 -05:00
|
|
|
from django.views import View
|
|
|
|
|
|
|
|
class LoadTimes(View):
|
|
|
|
|
|
|
|
def get(self, request):
|
|
|
|
from apps.statistics.models import MStatistics
|
|
|
|
|
2021-04-27 07:56:02 -05:00
|
|
|
data = {
|
2021-03-26 13:28:03 -05:00
|
|
|
'feed_loadtimes_avg_hour': MStatistics.get('latest_avg_time_taken'),
|
|
|
|
'feeds_loaded_hour': MStatistics.get('latest_sites_loaded'),
|
2021-04-27 07:56:02 -05:00
|
|
|
}
|
2021-04-30 13:48:48 -05:00
|
|
|
chart_name = "load_times"
|
|
|
|
chart_type = "histogram"
|
|
|
|
|
|
|
|
context = {
|
|
|
|
"data": data,
|
|
|
|
"chart_name": chart_name,
|
|
|
|
"chart_type": chart_type,
|
|
|
|
}
|
|
|
|
return render(request, 'monitor/prometheus_data.html', context)
|
2021-04-27 07:56:02 -05:00
|
|
|
|