示例#1
0
    def test_idle_time_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        idle_time = cpu_util.idle_time()

        self.assertEqual(idle_time, 0.11)
示例#2
0
    def test_nice_time_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        nice_time = cpu_util.nice_time()

        self.assertEqual(nice_time, 0.3)
示例#3
0
    def test_irq_soft_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        irq_soft = cpu_util.irq_soft()

        self.assertEqual(irq_soft, 0.07)
示例#4
0
    def test_irq_soft(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        irq_soft = cpu_util.irq_soft()

        self.assertEqual(irq_soft, 0.15)
示例#5
0
    def test_idle_time(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        idle_time = cpu_util.idle_time()

        self.assertEqual(idle_time, 0.22)
示例#6
0
    def test_user_time(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        user_time  = cpu_util.user_time()

        self.assertEqual(user_time,0.3)
示例#7
0
    def test_nice_time(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        nice_time = cpu_util.nice_time()

        self.assertEqual(nice_time, 0.6)
示例#8
0
    def test_user_time_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        user_time  = cpu_util.user_time()

        self.assertEqual(user_time,0.15)
示例#9
0
    def test_nice_time_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        nice_time  = cpu_util.nice_time()

        self.assertEqual(nice_time,0.3)
示例#10
0
    def test_guest_nice(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        guest_nice  = cpu_util.guest_nice()

        self.assertEqual(guest_nice,0.52)
示例#11
0
    def test_idle_time(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        idle_time  = cpu_util.idle_time()

        self.assertEqual(idle_time,0.22)
示例#12
0
    def test_irq_soft(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        irq_soft  = cpu_util.irq_soft()

        self.assertEqual(irq_soft,0.15)
示例#13
0
    def test_sys_time(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        sys_time  = cpu_util.sys_time()

        self.assertEqual(sys_time,0.82)
示例#14
0
    def test_nice_time(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        nice_time  = cpu_util.nice_time()

        self.assertEqual(nice_time,0.6)
示例#15
0
    def test_guest_time_if_current_value_is_none(self):
        cpu_util = CoreCpuUtil(2, 1.34, self.__metric_repository)

        guest_time = cpu_util.guest_time()

        self.assertIsNone(guest_time)
示例#16
0
    def test_sys_time_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        sys_time  = cpu_util.sys_time()

        self.assertEqual(sys_time,0.41)
示例#17
0
    def test_guest_nice_if_previous_value_is_none(self):
        cpu_util = CoreCpuUtil(1, 1.34, self.__metric_repository)

        guest_nice = cpu_util.guest_nice()

        self.assertIsNone(guest_nice)
示例#18
0
    def test_irq_soft_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        irq_soft  = cpu_util.irq_soft()

        self.assertEqual(irq_soft,0.07)
示例#19
0
    def test_user_time(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        user_time = cpu_util.user_time()

        self.assertEqual(user_time, 0.3)
示例#20
0
    def test_guest_nice_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        guest_nice  = cpu_util.guest_nice()

        self.assertEqual(guest_nice,0.26)
示例#21
0
    def test_sys_time(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        sys_time = cpu_util.sys_time()

        self.assertEqual(sys_time, 0.82)
示例#22
0
    def test_idle_time_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        idle_time  = cpu_util.idle_time()

        self.assertEqual(idle_time,0.11)
示例#23
0
    def test_guest_nice(self):
        cpu_util = CoreCpuUtil(0, 1.34, self.__metric_repository)

        guest_nice = cpu_util.guest_nice()

        self.assertEqual(guest_nice, 0.52)
示例#24
0
    def test_irq_hard_if_current_value_is_none(self):
        cpu_util = CoreCpuUtil(2, 1.34, self.__metric_repository)

        irq_hard  = cpu_util.irq_hard()

        self.assertIsNone(irq_hard)
示例#25
0
    def test_user_time_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        user_time = cpu_util.user_time()

        self.assertEqual(user_time, 0.15)
示例#26
0
    def test_guest_time_if_current_value_is_none(self):
        cpu_util = CoreCpuUtil(2, 1.34, self.__metric_repository)

        guest_time  = cpu_util.guest_time()

        self.assertIsNone(guest_time)
示例#27
0
    def test_sys_time_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        sys_time = cpu_util.sys_time()

        self.assertEqual(sys_time, 0.41)
示例#28
0
    def test_irq_soft_if_previous_value_is_none(self):
        cpu_util = CoreCpuUtil(1, 1.34, self.__metric_repository)

        irq_soft  = cpu_util.irq_soft()

        self.assertIsNone(irq_soft)
示例#29
0
    def test_guest_nice_for_all_cpus(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        guest_nice = cpu_util.guest_nice()

        self.assertEqual(guest_nice, 0.26)
示例#30
0
    def test_guest_nice_if_previous_value_is_none(self):
        cpu_util = CoreCpuUtil(1, 1.34, self.__metric_repository)

        guest_nice  = cpu_util.guest_nice()

        self.assertIsNone(guest_nice)
示例#31
0
    def test_irq_hard_if_current_value_is_none(self):
        cpu_util = CoreCpuUtil(2, 1.34, self.__metric_repository)

        irq_hard = cpu_util.irq_hard()

        self.assertIsNone(irq_hard)
示例#32
0
    def test_idle_time_if_previous_value_is_none(self):
        cpu_util = CoreCpuUtil(1, 1.34, self.__metric_repository)

        idle_time  = cpu_util.idle_time()

        self.assertIsNone(idle_time)
示例#33
0
    def test_irq_soft_if_previous_value_is_none(self):
        cpu_util = CoreCpuUtil(1, 1.34, self.__metric_repository)

        irq_soft = cpu_util.irq_soft()

        self.assertIsNone(irq_soft)
示例#34
0
    def test_cpu_online(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        test_cpu_online = cpu_util.cpu_online()

        self.assertEqual(test_cpu_online, 2)
示例#35
0
    def test_idle_time_if_previous_value_is_none(self):
        cpu_util = CoreCpuUtil(1, 1.34, self.__metric_repository)

        idle_time = cpu_util.idle_time()

        self.assertIsNone(idle_time)
示例#36
0
    def test_cpu_online(self):
        cpu_util = CoreCpuUtil(None, 1.34, self.__metric_repository)

        test_cpu_online  = cpu_util.cpu_online()

        self.assertEqual(test_cpu_online, 2)