Beispiel #1
0
def getPerfCpuClockData(server):

    profiler = PerfProfiler(server)
    data = profiler.getPerfCpuClock()

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

    return jsonify(data)
Beispiel #2
0
def getPerfFlameData(server):

    profiler = PerfProfiler(server)
    data = profiler.get_cmd_perf_flame()

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

    return jsonify(data)
Beispiel #3
0
def get_perf_cpu_clock(request):
    print('received perf.cpuclock.req: ' + request['server'])

    server = request['server']
    profiler = PerfProfiler(server)
    data = profiler.getPerfCpuClock()

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

    emit('perf.cpuclock.res', data)
Beispiel #4
0
def get_perf_flame(request):
    server = request['server']
    interval = request['interval']
    socketio = perf_blueprint.get_io()
    global perf_flame_timer
    if perf_flame_timer is None:
        perf_flame_timer = Timer(interval, background_timer_stuff, [
            socketio, interval, "perf.flame.res",
            PerfProfiler(server).get_cmd_perf_flame
        ])
        perf_flame_timer.start()
    emit("perf.flame.res", PerfProfiler(server).get_cmd_perf_flame())
Beispiel #5
0
class GetCmdPerfCpuclockTestCase(LepvTestCase):

    def setUp(self):
        self.profiler = PerfProfiler('')

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

        print("Actual:")
        pprint(actual)

        compare_result = DictUtil.compare(actual, expected)

        if expectedMatchType == 'equals':
            self.assertEqual(compare_result, 0, "Expected and Actual does not match")
        elif expectedMatchType == '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, expectedMatchType):
        self.describe(kernel, os, cpu, note, expectedMatchType, expected)

        actual = self.profiler.get_perf_cpu_clock(lepdResult)
        self.validate(expected, actual, expectedMatchType)
Beispiel #6
0
class GetCmdPerfFlameComponentTestCase(unittest.TestCase):
    def setUp(self):
        self.profiler = PerfProfiler('www.rmlink.cn')

    def test_flame_burner(self):

        flame_data = self.profiler.get_cmd_perf_flame()

        pprint(flame_data)
Beispiel #7
0
def get_perf_cpu_clock(request):
    server = request['server']
    process_socket_request(request, 'perf.cpuclock.req', PerfProfiler(server).get_perf_cpu_clock)
Beispiel #8
0
def get_perf_flame(request):
    server = request['server']
    process_socket_request(request, 'perf.flame.req', PerfProfiler(server).get_cmd_perf_flame)
Beispiel #9
0
 def test_stability(self):
     profiler = PerfProfiler('www.rmlink.cn')
     self.repeated_test(profiler.get_cmd_perf_flame)
Beispiel #10
0
 def test_stability(self):
     profiler = PerfProfiler('www.rmlink.cn')
     self.repeated_test(profiler.get_perf_cpu_clock)
Beispiel #11
0
 def setUp(self):
     self.profiler = PerfProfiler('')
Beispiel #12
0
 def setUp(self):
     self.profiler = PerfProfiler('www.rmlink.cn')
Beispiel #13
0
 def setUp(self):
     self.functor = PerfProfiler('').get_perf_cpu_clock