示例#1
0
文件: test_query.py 项目: ph87/koenig
    def test_query_disk_partitions(self):
        with koenig_client() as c:
            result = c.query_disk_partitions()
            self.assertTrue(isinstance(result, list))

            for item in result:
                self.assertTrue(isinstance(item, koenig_thrift.TDiskPartition))
示例#2
0
文件: test_query.py 项目: ph87/koenig
    def test_query_cpu_times_percent(self):
        with koenig_client() as c:
            result = c.query_cpu_times_percent()
            self.assertTrue(isinstance(result, koenig_thrift.TCPUTimesPercent))

            result = c.query_cpu_times_percent(0.1)
            self.assertTrue(isinstance(result, koenig_thrift.TCPUTimesPercent))
示例#3
0
文件: test_query.py 项目: ph87/koenig
    def test_query_cpu_percent(self):
        with koenig_client() as c:
            result = c.query_cpu_percent()
            self.assertTrue(isinstance(result, float))

            result = c.query_cpu_percent(0.1)
            self.assertTrue(isinstance(result, float))
示例#4
0
文件: test_query.py 项目: ph87/koenig
    def test_query_pids(self):
        with koenig_client() as c:
            result = c.query_pids()
            self.assertTrue(isinstance(result, list))

            for item in result:
                self.assertTrue(isinstance(item, int))
示例#5
0
文件: test_query.py 项目: ph87/koenig
    def test_query_cpu_times_percpu(self):
        with koenig_client() as c:
            result = c.query_cpu_times_percpu()
            self.assertTrue(isinstance(result, list))

            for item in result:
                self.assertTrue(isinstance(item, koenig_thrift.TCPUTimes))
示例#6
0
文件: test_query.py 项目: ph87/koenig
    def test_query_login_users(self):
        with koenig_client() as c:
            result = c.query_login_users()
            self.assertTrue(isinstance(result, list))

            for item in result:
                self.assertTrue(isinstance(item, koenig_thrift.TUser))
示例#7
0
文件: test_query.py 项目: ph87/koenig
    def test_query_disk_io_counters_perdisk(self):
        with koenig_client() as c:
            result = c.query_disk_io_counters_perdisk()
            self.assertTrue(isinstance(result, dict))

            for item in result.values():
                self.assertTrue(isinstance(item,
                                           koenig_thrift.TDiskIOCounters))
示例#8
0
文件: test_query.py 项目: ph87/koenig
    def test_query_runtime_statistic(self):
        with koenig_client() as c:
            result = c.query_runtime_statistic()
            self.assertTrue(isinstance(result, list))

            for item in result:
                self.assertTrue(isinstance(item,
                                           koenig_thrift.TRuntimeProfile))
示例#9
0
文件: test_query.py 项目: ph87/koenig
    def test_query_net_connections(self):
        with koenig_client() as c:
            result = c.query_net_connections()
            self.assertTrue(isinstance(result, list))

            for item in result:
                self.assertTrue(
                    isinstance(item, koenig_thrift.TNetworkConnections))
示例#10
0
文件: test_query.py 项目: ph87/koenig
    def test_query_processes_by_pids(self):
        pids = psutil.pids()

        with koenig_client() as c:
            result = c.query_processes_by_pids(pids)
            self.assertTrue(isinstance(result, dict))

            for item in result.values():
                self.assertTrue(isinstance(item, koenig_thrift.TProcess))
示例#11
0
文件: test_query.py 项目: ph87/koenig
    def test_query_cpu_percent_percpu(self):
        with koenig_client() as c:
            result = c.query_cpu_percent_percpu()
            self.assertTrue(isinstance(result, list))
            for item in result:
                self.assertTrue(isinstance(item, float))

            result = c.query_cpu_percent_percpu(0.1)
            self.assertTrue(isinstance(result, list))
            for item in result:
                self.assertTrue(isinstance(item, float))
示例#12
0
文件: test_query.py 项目: ph87/koenig
 def test_query_disk_io_counters(self):
     with koenig_client() as c:
         result = c.query_disk_io_counters()
         self.assertTrue(isinstance(result, koenig_thrift.TDiskIOCounters))
示例#13
0
文件: test_query.py 项目: ph87/koenig
 def test_query_swap_memory(self):
     with koenig_client() as c:
         result = c.query_swap_memory()
         self.assertTrue(isinstance(result, koenig_thrift.TSwapMemory))
示例#14
0
文件: test_query.py 项目: ph87/koenig
    def test_query_process_by_pid(self):
        pid = psutil.pids()[10]

        with koenig_client() as c:
            result = c.query_process_by_pid(pid)
            self.assertTrue(isinstance(result, koenig_thrift.TProcess))
示例#15
0
文件: test_query.py 项目: ph87/koenig
 def test_query_boot_time(self):
     with koenig_client() as c:
         result = c.query_boot_time()
         self.assertTrue(isinstance(result, (unicode, str)))
示例#16
0
文件: test_query.py 项目: ph87/koenig
 def test_query_disk_usage(self):
     with koenig_client() as c:
         result = c.query_disk_usage('/')
         self.assertTrue(isinstance(result, koenig_thrift.TDiskUsage))