예제 #1
0
def asynchronous_metrics(request):
    id = request.GET.get("id")
    start = request.GET.get("start").split("-")
    end = request.GET.get("end").split("-")

    start_date = date(int(start[0]), int(start[1]), int(start[2]))
    end_date = date(int(end[0]), int(end[1]), int(end[2]))
    
    fetcher = MongoFetcher(**MONGODB_SETTINGS)

    summary = fetcher.fetch(id=id, start_date=start_date, end_date=end_date)

    return render_to_response("table.html", { "actions" : summary["action_types"], "summary" : summary["summary"] })
예제 #2
0
def metrics(request):
    fetcher = MongoFetcher(**MONGODB_SETTINGS)

    summary = fetcher.fetch(id=1, start_date=(date(2011, 9, 1)), end_date=date.today())

    return render_to_response("metrics.html", { "actions" : summary["action_types"], "summary" : summary["summary"] })