Esempio n. 1
0
def getMemoryProcrank(server):

    profiler = MemoryProfiler(server)
    data = profiler.getProcrank()

    if 'request_id' in request.args:
        data['response_id'] = request.args['request_id']

    return jsonify(data)
Esempio n. 2
0
def get_proc_rank(request):
    server = request['server']
    interval = request['interval']
    socketio = memory_blueprint.get_io()
    global memory_procrank_timer
    if memory_procrank_timer is None:
        memory_procrank_timer = Timer(interval, background_timer_stuff, [
            socketio, interval, "memory.procrank.res", MemoryProfiler(server).getProcrank])
        memory_procrank_timer.start()
    emit("memory.procrank.res", MemoryProfiler(server).getProcrank())
Esempio n. 3
0
def get_memory_status(request):
    server = request['server']
    interval = request['interval']
    socketio = memory_blueprint.get_io()
    global memory_status_timer
    if memory_status_timer is None:
        memory_status_timer = Timer(interval, background_timer_stuff, [
            socketio, interval, "memory.status.res", MemoryProfiler(server).getStatus])
        memory_status_timer.start()
    emit("memory.status.res", MemoryProfiler(server).getStatus())
Esempio n. 4
0
def get_proc_rank(request):
    print('received memory.procrank.req: ' + request['server'])

    server = request['server']
    profiler = MemoryProfiler(server)
    data = profiler.getProcrank()

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

    emit('memory.procrank.res', data)
Esempio n. 5
0
def get_memory_status(request):
    print('received memory.status.req: ' + request['server'])

    server = request['server']
    profiler = MemoryProfiler(server)
    data = {}
    data = profiler.getStatus()

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

    emit('memory.status.res', data)
Esempio n. 6
0
class GetProcMeminfoTestCase(LepvTestCase):
    def setUp(self):
        self.profiler = MemoryProfiler('')

    def validate(self, expected, actual, expected_match_type):

        print("Actual:")
        pprint(actual)

        compare_result = DictUtil.compare(actual, expected)

        if expected_match_type == 'equals':
            self.assertEqual(compare_result, 0,
                             "Expected and Actual does not match")
        elif expected_match_type == 'contains':
            self.assertIn(compare_result, [0, 1],
                          "Actual does not contain the expected")
        else:
            print("")

    @file_data("unittests.json")
    def test(self, kernel, os, cpu, note, lepdResult, expected,
             expected_match_type):
        self.describe(kernel, os, cpu, note, expected_match_type, expected)

        # getStatus -> GetProcMeminfo
        actual = self.profiler.getStatus(lepdResult)
        self.validate(expected, actual, expected_match_type)
Esempio n. 7
0
 def test_stability(self):
     profiler = MemoryProfiler('www.rmlink.cn')
     self.repeated_test(profiler.getStatus)
Esempio n. 8
0
 def setUp(self):
     self.functor = MemoryProfiler('').getCapacity
Esempio n. 9
0
 def setUp(self):
     self.profiler = MemoryProfiler('')
Esempio n. 10
0
def get_memory_status(request):
    server = request['server']
    process_socket_request(request, 'memory.status.req',
                           MemoryProfiler(server).getStatus)
Esempio n. 11
0
def get_proc_rank(request):
    server = request['server']
    process_socket_request(request, 'memory.procrank.req',
                           MemoryProfiler(server).getProcrank)
Esempio n. 12
0
 def setUp(self):
     self.functor = MemoryProfiler('').getProcrank