Esempio n. 1
0
def metadata(request, version = None):
    results = handler.metadata(version)

    if results['success'] == False:
        return __renderErrorJSON__(results['message'])

    return HttpResponse(json.dumps(results), content_type='application/json')
Esempio n. 2
0
def metadata(request, version = None):
    results = handler.metadata(version)

    if results['success'] == False:
        return __renderErrorJSON__(results['message'])

    return HttpResponse(json.dumps(results), content_type='application/json')
Esempio n. 3
0
def stats(request):
    stats = handler.cluster_stats()
    allversions = handler.metadata()
    if allversions['success']:
        lastimport = allversions['data'][-1]
        lastten = allversions['data'][-10:]
    else:
        #XXX TODO returne error
        pass

    if lastten[0]['metadata'] == 0:
        lastten = lastten[1:]

    context = __createRequestContext__(request, data = {'domainStats': stats['domainStats'], 
                                                        'histogram': stats['histogram'],
                                                        'lastten': lastten,
                                                        'lastimport': lastimport})
    return render_to_response('stats.html', context)
Esempio n. 4
0
def stats(request):
    stats = handler.cluster_stats()
    allversions = handler.metadata()
    if allversions['success']:
        lastimport = allversions['data'][-1]
        lastten = allversions['data'][-10:]
    else:
        #XXX TODO returne error
        pass

    if lastten[0]['metadata'] == 0:
        lastten = lastten[1:]

    context = __createRequestContext__(request,
                                       data={
                                           'domainStats': stats['domainStats'],
                                           'histogram': stats['histogram'],
                                           'lastten': lastten,
                                           'lastimport': lastimport
                                       })
    return render_to_response('stats.html', context)