本文整理汇总了Python中ovs.dal.hybrids.vdisk.VDisk.calculate_delta方法的典型用法代码示例。如果您正苦于以下问题:Python VDisk.calculate_delta方法的具体用法?Python VDisk.calculate_delta怎么用?Python VDisk.calculate_delta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ovs.dal.hybrids.vdisk.VDisk
的用法示例。
在下文中一共展示了VDisk.calculate_delta方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _statistics
# 需要导入模块: from ovs.dal.hybrids.vdisk import VDisk [as 别名]
# 或者: from ovs.dal.hybrids.vdisk.VDisk import calculate_delta [as 别名]
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
示例2: _statistics
# 需要导入模块: from ovs.dal.hybrids.vdisk import VDisk [as 别名]
# 或者: from ovs.dal.hybrids.vdisk.VDisk import calculate_delta [as 别名]
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
示例3: _statistics
# 需要导入模块: from ovs.dal.hybrids.vdisk import VDisk [as 别名]
# 或者: from ovs.dal.hybrids.vdisk.VDisk import calculate_delta [as 别名]
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