def _statistics(self, dynamic): """ Aggregates the Statistics (IOPS, Bandwidth, ...) of the vDisks connected to the Storage Driver. """ from ovs.dal.hybrids.vdisk import VDisk statistics = {} for key, value in self.fetch_statistics().iteritems(): statistics[key] = value statistics['timestamp'] = time.time() VDisk.calculate_delta(self._key, dynamic, statistics) return statistics
def _statistics(self, dynamic): """ Aggregates the Statistics (IOPS, Bandwidth, ...) of the vDisks connected to the Storage Driver. """ from ovs.dal.hybrids.vdisk import VDisk statistics = {} for key in StorageDriverClient.STAT_KEYS: statistics[key] = 0 statistics['{0}_ps'.format(key)] = 0 for key, value in self.fetch_statistics().iteritems(): statistics[key] += value statistics['timestamp'] = time.time() VDisk.calculate_delta(self._key, dynamic, statistics) return statistics
def _statistics(self, dynamic): """ Aggregates the Statistics (IOPS, Bandwidth, ...) of each vDisk of the vMachine. """ from ovs.dal.hybrids.vdisk import VDisk statistics = {} for key in StorageDriverClient.STAT_KEYS: statistics[key] = 0 statistics['{0}_ps'.format(key)] = 0 for vdisk in self.vdisks: for key, value in vdisk.fetch_statistics().iteritems(): statistics[key] += value statistics['timestamp'] = time.time() VDisk.calculate_delta(self._key, dynamic, statistics) return statistics
def _statistics(self, dynamic): """ Aggregates the Statistics (IOPS, Bandwidth, ...) of each vDisk served by the vPool. """ from ovs.dal.hybrids.vdisk import VDisk statistics = {} for key in StorageDriverClient.stat_keys: statistics[key] = 0 statistics['{0}_ps'.format(key)] = 0 for vdisk in self.vdisks: for key, value in vdisk.fetch_statistics().iteritems(): statistics[key] += value statistics['timestamp'] = time.time() VDisk.calculate_delta(self._key, dynamic, statistics) return statistics
def _statistics(self, dynamic): """ Aggregates the Statistics (IOPS, Bandwidth, ...) of each vDisk of the vMachine. """ from ovs.dal.hybrids.vdisk import VDisk statistics = {} for key in StorageDriverClient.STAT_KEYS: statistics[key] = 0 statistics['{0}_ps'.format(key)] = 0 for storagedriver in self.storagedrivers: for vdisk in storagedriver.vpool.vdisks: if vdisk.storagedriver_id == storagedriver.storagedriver_id: for key, value in vdisk.fetch_statistics().iteritems(): statistics[key] += value statistics['timestamp'] = time.time() VDisk.calculate_delta(self._key, dynamic, statistics) return statistics
def _statistics(self, dynamic): """ Aggregates the Statistics (IOPS, Bandwidth, ...) of each vDisk. """ from ovs.dal.hybrids.vdisk import VDisk statistics = {} for storagedriver in self.storagedrivers: for key, value in storagedriver.fetch_statistics().iteritems(): if isinstance(value, dict): if key not in statistics: statistics[key] = {} for subkey, subvalue in value.iteritems(): if subkey not in statistics[key]: statistics[key][subkey] = 0 statistics[key][subkey] += subvalue else: if key not in statistics: statistics[key] = 0 statistics[key] += value statistics['timestamp'] = time.time() VDisk.calculate_delta(self._key, dynamic, statistics) return statistics