예제 #1
0
파일: views.py 프로젝트: macxu/lepv
def getCpuTop(server):

    profiler = CPUProfiler(server)
    data = profiler.getTopOutput()

    if 'request_id' in request.args:
        data['response_id'] = request.args['request_id']
    return jsonify(data)
예제 #2
0
def get_top(request):
    print('received cpu.top.req: ' + request['server'])

    server = request['server']
    profiler = CPUProfiler(server)
    data = profiler.getTopOutput()

    if "request_id" in request:
        data['response_id'] = request['request_id']

    emit('cpu.top.res', data)