Esempio n. 1
0
    def test_get_samples_with_empty_stats(self):
        self._mock_inspect_instance(virt_inspector.NoDataException())
        mgr = manager.AgentManager(0, self.CONF)
        pollster = instance_stats.PerfCPUCyclesPollster(self.CONF)

        def all_samples():
            return list(pollster.get_samples(mgr, {}, [self.instance]))
Esempio n. 2
0
        def _check_perf_events_cpu_cycles(expected_usage):
            pollster = instance_stats.PerfCPUCyclesPollster(self.CONF)

            samples = list(pollster.get_samples(mgr, cache, [self.instance]))
            self.assertEqual(1, len(samples))
            self.assertEqual(set(['perf.cpu.cycles']),
                             set([s.name for s in samples]))
            self.assertEqual(expected_usage, samples[0].volume)