예제 #1
0
파일: views.py 프로젝트: malazay/ASM
def ajax(request):
    data = collections.OrderedDict()
    cpu_count = percore_cpu()
    coredata = collections.OrderedDict()
    for core in cpu_count:
        coredata[core[0]] = core[1]
    data = coredata
    return HttpResponse(json.dumps(data), content_type="application/json")
예제 #2
0
파일: views.py 프로젝트: malazay/ASM
def monitor(request):
    cpu_count = percore_cpu()
    server_list = Server.objects.all()
    context = {'server_list': server_list, 'cpu_count': cpu_count}
    return render(request, 'dashboard/monitor.html', context)