Example #1
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)
Example #2
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)
Example #3
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)
Example #4
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)
Example #5
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)
Example #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)
Example #7
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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #15
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)
Example #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)
Example #17
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)
Example #18
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)