Ejemplo n.º 1
0
def getCpuCapacity(server):
    # options = {
    #     'is_debug': False,
    #     'request_id': 0
    # }
    # if not request.args['debug']:
    #     options['is_debug'] = request.args['debug']
    # if not request.args['request_id']:
    #     options['request_id'] = request.args['request_id']

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

    return jsonify(data)
Ejemplo n.º 2
0
class CpuProfilerTest(unittest.TestCase):
    def setUp(self):
        self.server = 'www.linuxxueyuan.com'
        self.profiler = CPUProfiler(self.server)

    def test_getCpuCount(self):

        returnedData = self.profiler.getProcessorCount()

        self.assertIn('count', returnedData,
                      "'count' is not a key in the returned object")

        count = returnedData['count']
        self.assertTrue(isinstance(count, int),
                        "CPU processor count '%s' is not an integer" % count)
Ejemplo n.º 3
0
class CpuProfilerTest(unittest.TestCase):
    def setUp(self):
        self.server = 'www.rmlink.cn'
        self.profiler = CPUProfiler(self.server)

    def test_getCpuCount(self):

        returnedData = self.profiler.getProcessorCount()

        self.assertIn('count', returnedData,
                      "'count' is not a key in the returned object")

        count = returnedData['count']
        self.assertTrue(isinstance(count, int),
                        "CPU processor count '%s' is not an integer" % count)

    @file_data("unittests.json")
    def test_parsing(self, test_case):
        print(test_case)
Ejemplo n.º 4
0
 def setUp(self):
     self.server = 'www.linuxxueyuan.com'
     self.profiler = CPUProfiler(self.server)
Ejemplo n.º 5
0
 def setUp(self):
     self.server = 'www.rmlink.cn'
     self.profiler = CPUProfiler(self.server)
Ejemplo n.º 6
0
def getAverageLoad(server):

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

    return jsonify(data)
Ejemplo n.º 7
0
def getCpuTop(server):

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

    return jsonify(data)
Ejemplo n.º 8
0
def getCpuStat(server):

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

    return jsonify(data)
Ejemplo n.º 9
0
def getCpuCount(server):

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

    return jsonify(data)
Ejemplo n.º 10
0
def getCpuCapacity(server):

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

    return jsonify(data)