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)
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)