Exemplo n.º 1
0
    def test_disk_all_keys_present(self):
        interval = 10  # seconds
        drives = (FakeDrive(name='hdc', size=700 * MiB), )
        testvm = FakeVM(drives=drives)

        stats = {}
        stats_before = copy.deepcopy(self.bulk_stats)
        stats_after = copy.deepcopy(self.bulk_stats)
        _ensure_delta(stats_before, stats_after, 'block.0.rd.reqs', KiB)
        _ensure_delta(stats_before, stats_after, 'block.0.rd.bytes', 128 * KiB)
        vmstats.disks(testvm, stats, stats_before, stats_after, interval)
        self.assertRepeatedStatsHaveKeys(drives, stats['disks'],
                                         self._EXPECTED_KEYS)
Exemplo n.º 2
0
    def test_disk_all_keys_present(self):
        interval = 10  # seconds
        drives = (FakeDrive(name='hdc', size=700 * 1024 * 1024),)
        testvm = FakeVM(drives=drives)

        stats = {}
        stats_before = copy.deepcopy(self.bulk_stats)
        stats_after = copy.deepcopy(self.bulk_stats)
        _ensure_delta(stats_before, stats_after,
                      'block.0.rd.reqs', 1024)
        _ensure_delta(stats_before, stats_after,
                      'block.0.rd.bytes', 128 * 1024)
        vmstats.disks(testvm, stats,
                      stats_before, stats_after,
                      interval)
        self.assertRepeatedStatsHaveKeys(drives, stats['disks'],
                                         self._EXPECTED_KEYS)