def stats(): stats = { 'bin_count': db.count_bins(), 'request_count': db.count_requests(), 'avg_req_size_kb': db.avg_req_size(), } resp = make_response(json.dumps(stats), 200) resp.headers['Content-Type'] = 'application/json' return resp
def stats(): stats = { 'bin_count': db.count_bins(), 'request_count': db.count_requests(), 'avg_req_size_kb': db.avg_req_size(),} resp = make_response(json.dumps(stats), 200) resp.headers['Content-Type'] = 'application/json' return resp
def stats(): stats = {"bin_count": db.count_bins(), "request_count": db.count_requests(), "avg_req_size_kb": db.avg_req_size()} resp = make_response(json.dumps(stats), 200) resp.headers["Content-Type"] = "application/json" return resp