当前位置: 首页>>代码示例>>Python>>正文


Python TestDisk.machine方法代码示例

本文整理汇总了Python中ovs.dal.hybrids.t_testdisk.TestDisk.machine方法的典型用法代码示例。如果您正苦于以下问题:Python TestDisk.machine方法的具体用法?Python TestDisk.machine怎么用?Python TestDisk.machine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ovs.dal.hybrids.t_testdisk.TestDisk的用法示例。


在下文中一共展示了TestDisk.machine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_recursive

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_recursive(self):
     """
     Validates the recursive save
     """
     machine = TestMachine()
     machine.name = 'original'
     machine.save()
     disks = []
     for i in xrange(0, 10):
         disk = TestDisk()
         disk.name = 'test_{0}'.format(i)
         if i % 2:
             disk.machine = machine
         else:
             disk.machine = machine
             self.assertEqual(disk.machine.name, 'original', 'child should be set')
             disk.machine = None
             self.assertIsNone(disk.machine, 'child should be cleared')
             disks.append(disk)
         disk.save()
     counter = 1
     for disk in machine.disks:
         disk.size = counter
         counter += 1
     machine.save(recursive=True)
     disk = TestDisk(machine.disks[0].guid)
     self.assertEqual(disk.size, 1, 'lists should be saved recursively')
     disk.machine.name = 'mtest'
     disk.save(recursive=True)
     machine2 = TestMachine(machine.guid)
     self.assertEqual(machine2.disks[1].size, 2, 'lists should be saved recursively')
     self.assertEqual(machine2.name, 'mtest', 'properties should be saved recursively')
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:34,代码来源:test_basic.py

示例2: test_relationcache

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_relationcache(self):
     """
     Validates whether the relational properties are cached correctly, and whether
     they are invalidated when required
     """
     machine = TestMachine()
     machine.name = 'machine'
     machine.save()
     disk1 = TestDisk()
     disk1.name = 'disk1'
     disk1.save()
     disk2 = TestDisk()
     disk2.name = 'disk2'
     disk2.save()
     disk3 = TestDisk()
     disk3.name = 'disk3'
     disk3.save()
     self.assertEqual(len(machine.disks), 0, 'There should be no disks on the machine')
     disk1.machine = machine
     disk1.save()
     self.assertEqual(len(machine.disks), 1, 'There should be 1 disks on the machine')
     disk2.machine = machine
     disk2.save()
     self.assertEqual(len(machine.disks), 2, 'There should be 2 disks on the machine')
     disk3.machine = machine
     disk3.save()
     self.assertEqual(len(machine.disks), 3, 'There should be 3 disks on the machine')
     machine.disks[0].name = 'disk1_'
     machine.disks[1].name = 'disk2_'
     machine.disks[2].name = 'disk3_'
     disk1.machine = None
     disk1.save()
     disk2.machine = None
     disk2.save()
     self.assertEqual(len(machine.disks), 1, 'There should be 1 disks on the machine')
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:37,代码来源:test_basic.py

示例3: test_saveorder

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_saveorder(self):
     """
     Validates whether the order of saving related objects doesn't matter
     """
     machine1 = TestMachine()
     machine1.name = 'machine'
     disk1_1 = TestDisk()
     disk1_1.name = 'disk1'
     disk1_1.machine = machine1
     disk1_1.save()
     disk1_2 = TestDisk()
     disk1_2.name = 'disk2'
     disk1_2.machine = machine1
     disk1_2.save()
     machine1.save()
     self.assertEqual(len(machine1.disks), 2, 'There should be two disks. {0}'.format(len(machine1.disks)))
     machine2 = TestMachine()
     machine2.name = 'machine'
     machine2.save()
     disk2_1 = TestDisk()
     disk2_1.name = 'disk1'
     disk2_1.machine = machine2
     disk2_1.save()
     disk2_2 = TestDisk()
     disk2_2.name = 'disk2'
     disk2_2.machine = machine2
     disk2_2.save()
     self.assertEqual(len(machine2.disks), 2, 'There should be two disks. {0}'.format(len(machine2.disks)))
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:30,代码来源:test_basic.py

示例4: test_datalistactions

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_datalistactions(self):
     """
     Validates all actions that can be executed agains DataLists
     """
     machine = TestMachine()
     machine.name = 'machine'
     machine.save()
     disk1 = TestDisk()
     disk1.name = 'disk1'
     disk1.machine = machine
     disk1.save()
     disk2 = TestDisk()
     disk2.name = 'disk2'
     disk2.machine = machine
     disk2.save()
     disk3 = TestDisk()
     disk3.name = 'disk3'
     disk3.machine = machine
     disk3.save()
     self.assertEqual(machine.disks.count(disk1), 1, 'Disk should be available only once')
     self.assertGreaterEqual(machine.disks.index(disk1), 0, 'We should retreive an index')
     machine.disks.sort()
     guid = machine.disks[0].guid
     machine.disks.reverse()
     self.assertEqual(machine.disks[-1].guid, guid, 'Reverse and sort should work')
     machine.disks.sort()
     self.assertEqual(machine.disks[0].guid, guid, 'And the guid should be first again')
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:29,代码来源:test_basic.py

示例5: test_listcache

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_listcache(self):
     """
     Validates whether lists are cached and invalidated correctly
     """
     keys = ['list_cache', None]
     for key in keys:
         disk0 = TestDisk()
         disk0.name = 'disk 0'
         disk0.save()
         list_cache = DataList(key=key,
                               query={'object': TestDisk,
                                      'data': DataList.select.COUNT,
                                      'query': {'type': DataList.where_operator.AND,
                                                'items': [('machine.name', DataList.operator.EQUALS, 'machine')]}})  # noqa
         self.assertFalse(list_cache.from_cache, 'List should not be loaded from cache (mode: {0})'.format(key))
         self.assertEqual(list_cache.data, 0, 'List should find no entries (mode: {0})'.format(key))
         machine = TestMachine()
         machine.name = 'machine'
         machine.save()
         disk1 = TestDisk()
         disk1.name = 'disk 1'
         disk1.machine = machine
         disk1.save()
         list_cache = DataList(key=key,
                               query={'object': TestDisk,
                                      'data': DataList.select.COUNT,
                                      'query': {'type': DataList.where_operator.AND,
                                                'items': [('machine.name', DataList.operator.EQUALS, 'machine')]}})  # noqa
         self.assertFalse(list_cache.from_cache, 'List should not be loaded from cache (mode: {0})'.format(key))
         self.assertEqual(list_cache.data, 1, 'List should find one entry (mode: {0})'.format(key))
         list_cache = DataList(key=key,
                               query={'object': TestDisk,
                                      'data': DataList.select.COUNT,
                                      'query': {'type': DataList.where_operator.AND,
                                                'items': [('machine.name', DataList.operator.EQUALS, 'machine')]}})  # noqa
         self.assertTrue(list_cache.from_cache, 'List should be loaded from cache (mode: {0})'.format(key))
         disk2 = TestDisk()
         disk2.machine = machine
         disk2.name = 'disk 2'
         disk2.save()
         list_cache = DataList(key=key,
                               query={'object': TestDisk,
                                      'data': DataList.select.COUNT,
                                      'query': {'type': DataList.where_operator.AND,
                                                'items': [('machine.name', DataList.operator.EQUALS, 'machine')]}})  # noqa
         self.assertFalse(list_cache.from_cache, 'List should not be loaded from cache (mode: {0})'.format(key))
         self.assertEqual(list_cache.data, 2, 'List should find two entries (mode: {0})'.format(key))
         machine.name = 'x'
         machine.save()
         list_cache = DataList(key=key,
                               query={'object': TestDisk,
                                      'data': DataList.select.COUNT,
                                      'query': {'type': DataList.where_operator.AND,
                                                'items': [('machine.name', DataList.operator.EQUALS, 'machine')]}})  # noqa
         self.assertFalse(list_cache.from_cache, 'List should not be loaded from cache (mode: {0})'.format(key))
         self.assertEqual(list_cache.data, 0, 'List should have no matches (mode: {0})'.format(key))
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:58,代码来源:test_basic.py

示例6: test_copy

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_copy(self):
     """
     Validates whether the copy function works correct
     """
     machine = TestMachine()
     machine.name = 'testmachine1'
     machine.save()
     disk1 = TestDisk()
     disk1.name = 'test1'
     disk1.size = 100
     disk1.order = 1
     disk1.type = 'ONE'
     disk1.machine = machine
     disk1.save()
     disk2 = TestDisk()
     disk2.copy(disk1)
     self.assertEqual(disk2.name, 'test1', 'Properties should be copied')
     self.assertEqual(disk2.size, 100, 'Properties should be copied')
     self.assertEqual(disk2.order, 1, 'Properties should be copied')
     self.assertEqual(disk2.type, 'ONE', 'Properties should be copied')
     self.assertEqual(disk2.machine, None, 'Relations should not be copied')
     disk3 = TestDisk()
     disk3.copy(disk1, include_relations=True)
     self.assertEqual(disk3.machine.name, 'testmachine1', 'Relations should be copied')
     disk4 = TestDisk()
     disk4.copy(disk1, include=['name'])
     self.assertEqual(disk4.name, 'test1', 'Name should be copied')
     self.assertEqual(disk4.size, 0, 'Size should not be copied')
     self.assertEqual(disk4.machine, None, 'Relations should not be copied')
     disk5 = TestDisk()
     disk5.copy(disk1, exclude=['name'])
     self.assertEqual(disk5.name, None, 'Name should not be copied')
     self.assertEqual(disk5.size, 100, 'Size should be copied')
     self.assertEqual(disk5.machine, None, 'Relations should not be copied')
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:36,代码来源:test_basic.py

示例7: test_invalidqueries

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_invalidqueries(self):
     """
     Validates invalid queries
     """
     machine = TestMachine()
     machine.name = 'machine'
     machine.save()
     disk = TestDisk()
     disk.name = 'disk'
     disk.machine = machine
     disk.save()
     setattr(DataList.select, 'SOMETHING', 'SOMETHING')
     with self.assertRaises(NotImplementedError):
         DataList({'object': TestDisk,
                   'data': DataList.select.SOMETHING,
                   'query': {'type': DataList.where_operator.AND,
                             'items': [('machine.name', DataList.operator.EQUALS, 'machine')]}})  # noqa
     setattr(DataList.where_operator, 'SOMETHING', 'SOMETHING')
     with self.assertRaises(NotImplementedError):
         DataList({'object': TestDisk,
                   'data': DataList.select.COUNT,
                   'query': {'type': DataList.where_operator.SOMETHING,
                             'items': [('machine.name', DataList.operator.EQUALS, 'machine')]}})  # noqa
     setattr(DataList.operator, 'SOMETHING', 'SOMETHING')
     with self.assertRaises(NotImplementedError):
         DataList({'object': TestDisk,
                   'data': DataList.select.COUNT,
                   'query': {'type': DataList.where_operator.AND,
                             'items': [('machine.name', DataList.operator.SOMETHING, 'machine')]}})  # noqa
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:31,代码来源:test_basic.py

示例8: test_mandatory_fields

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_mandatory_fields(self):
     """
     Validates whether mandatory properties and relations work
     """
     machine = TestMachine()
     machine.extended = 'extended'
     machine.name = 'machine'
     machine.save()
     disk = TestDisk()
     # Modify relation to mandatory
     [_ for _ in disk._relations if _.name == 'machine'][0].mandatory = True
     # Continue test
     disk.name = None
     with self.assertRaises(MissingMandatoryFieldsException) as exception:
         disk.save()
     self.assertIn('name', exception.exception.message, 'Field name should be in exception message: {0}'.format(exception.exception.message))
     self.assertIn('machine', exception.exception.message, 'Field machine should be in exception message: {0}'.format(exception.exception.message))
     disk.name = 'disk'
     disk.machine = machine
     disk.save()
     disk.description = 'test'
     disk.storage = machine
     disk.save()
     # Restore relation
     [_ for _ in disk._relations if _.name == 'machine'][0].mandatory = False
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:27,代码来源:test_basic.py

示例9: test_invalidpropertyassignment

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_invalidpropertyassignment(self):
     """
     Validates whether the correct exception is raised when properties are assigned with a wrong
     type
     """
     disk = TestDisk()
     disk.size = 100
     with self.assertRaises(TypeError):
         disk.machine = TestDisk()
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:11,代码来源:test_basic.py

示例10: test_outdated_listobjects

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_outdated_listobjects(self):
     """
     Validates whether elements in a (cached) list are reloaded if they are changed externally
     """
     machine = TestMachine()
     machine.name = 'machine'
     machine.save()
     disk1 = TestDisk()
     disk1.name = 'disk1'
     disk1.machine = machine
     disk1.save()
     disk2 = TestDisk()
     disk2.name = 'disk2'
     disk2.machine = machine
     disk2.save()
     self.assertListEqual(['disk1', 'disk2'], sorted([disk.name for disk in machine.disks]), 'Names should be disk1 and disk2')
     disk2.name = 'disk_'
     self.assertListEqual(['disk1', 'disk2'], sorted([disk.name for disk in machine.disks]), 'Names should still be disk1 and disk2')
     disk2.save()
     self.assertListEqual(['disk1', 'disk_'], sorted([disk.name for disk in machine.disks]), 'Names should be disk1 and disk_')
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:22,代码来源:test_basic.py

示例11: test_delete_abandoning

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_delete_abandoning(self):
     """
     Validates the abandoning behavior of the delete method
     """
     machine = TestMachine()
     machine.name = 'machine'
     machine.save()
     disk_1 = TestDisk()
     disk_1.name = 'disk 1'
     disk_1.machine = machine
     disk_1.save()
     disk_2 = TestDisk()
     disk_2.name = 'disk 2'
     disk_2.machine = machine
     disk_2.save()
     self.assertRaises(LinkedObjectException, machine.delete)
     disk_3 = TestDisk(disk_1.guid)
     self.assertIsNotNone(disk_3.machine, 'The machine should still be linked')
     _ = machine.disks  # Make sure we loaded the list
     disk_2.delete()
     machine.delete(abandon=True)  # Should not raise due to disk_2 being deleted
     disk_4 = TestDisk(disk_1.guid)
     self.assertIsNone(disk_4.machine, 'The machine should be unlinked')
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:25,代码来源:test_basic.py

示例12: test_relation_inheritance

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
    def test_relation_inheritance(self):
        """
        Validates whether relations on inherited hybrids behave OK
        """
        machine = TestMachine()
        machine.name = 'machine'
        machine.save()
        disk = TestDisk()
        disk.name = 'disk'
        disk.machine = machine  # Validates relation acceptance (accepts TestEMachine)
        disk.save()
        machine.the_disk = disk  # Validates whether _relations is build correctly
        machine.save()

        disk2 = TestDisk(disk.guid)
        self.assertEqual(Descriptor(disk2.machine.__class__), Descriptor(TestEMachine), 'The machine should be a TestEMachine')
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:18,代码来源:test_basic.py

示例13: test_guid_query

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
    def test_guid_query(self):
        """
        Validates whether queries can use the _guid fields
        """
        machine = TestMachine()
        machine.name = 'machine'
        machine.save()
        disk = TestDisk()
        disk.name = 'test'
        disk.machine = machine
        disk.save()

        data = DataList({'object': TestDisk,
                         'data': DataList.select.GUIDS,
                         'query': {'type': DataList.where_operator.AND,
                                   'items': [('machine_guid', DataList.operator.EQUALS, machine.guid)]}}).data
        disks = DataObjectList(data, TestDisk)
        self.assertEqual(len(disks), 1, 'There should be one disk ({0})'.format(len(disks)))
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:20,代码来源:test_basic.py

示例14: test_serialization

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
 def test_serialization(self):
     """
     Validates whether serialization works as expected
     """
     machine = TestMachine()
     machine.name = 'machine'
     machine.save()
     disk = TestDisk()
     disk.name = 'disk'
     disk.machine = machine
     disk.save()
     dictionary = disk.serialize()
     self.assertIn('name', dictionary, 'Serialized object should have correct properties')
     self.assertEqual(dictionary['name'], 'disk', 'Serialized object should have correct name')
     self.assertIn('machine_guid', dictionary, 'Serialized object should have correct depth')
     self.assertEqual(dictionary['machine_guid'], machine.guid,
                      'Serialized object should have correct properties')
     dictionary = disk.serialize(depth=1)
     self.assertIn('machine', dictionary, 'Serialized object should have correct depth')
     self.assertEqual(dictionary['machine']['name'], 'machine',
                      'Serialized object should have correct properties at all depths')
开发者ID:BillTheBest,项目名称:openvstorage,代码行数:23,代码来源:test_basic.py

示例15: test_lotsofobjects

# 需要导入模块: from ovs.dal.hybrids.t_testdisk import TestDisk [as 别名]
# 或者: from ovs.dal.hybrids.t_testdisk.TestDisk import machine [as 别名]
    def test_lotsofobjects(self):
        """
        A test creating, linking and querying a lot of objects
        """
        print ''
        print 'cleaning up'
        self._clean_all()
        print 'start test'
        tstart = time.time()
        if getattr(LotsOfObjects, 'amount_of_machines', None) is None:
            LotsOfObjects.amount_of_machines = 50
        if getattr(LotsOfObjects, 'amount_of_disks', None) is None:
            LotsOfObjects.amount_of_disks = 5
        load_data = True
        if load_data:
            print 'start loading data'
            start = time.time()
            mguids = []
            runtimes = []
            for i in xrange(0, int(LotsOfObjects.amount_of_machines)):
                mstart = time.time()
                machine = TestMachine()
                machine.name = 'machine_{0}'.format(i)
                machine.save()
                mguids.append(machine.guid)
                for ii in xrange(0, int(LotsOfObjects.amount_of_disks)):
                    disk = TestDisk()
                    disk.name = 'disk_{0}_{1}'.format(i, ii)
                    disk.size = ii * 100
                    disk.machine = machine
                    disk.save()
                avgitemspersec = ((i + 1) * LotsOfObjects.amount_of_disks) / (time.time() - start)
                itemspersec = LotsOfObjects.amount_of_disks / (time.time() - mstart)
                runtimes.append(itemspersec)
                self._print_progress('* machine {0}/{1} (run: {2} dps, avg: {3} dps)'.format(i + 1, int(LotsOfObjects.amount_of_machines), round(itemspersec, 2), round(avgitemspersec, 2)))
            runtimes.sort()
            print '\nloading done ({0}s). min: {1} dps, max: {2} dps'.format(round(time.time() - tstart, 2), round(runtimes[1], 2), round(runtimes[-2], 2))

        test_queries = True
        if test_queries:
            print 'start queries'
            start = time.time()
            runtimes = []
            for i in xrange(0, int(LotsOfObjects.amount_of_machines)):
                mstart = time.time()
                machine = TestMachine(mguids[i])
                self.assertEqual(len(machine.disks), LotsOfObjects.amount_of_disks, 'Not all disks were retreived ({0})'.format(len(machine.disks)))
                avgitemspersec = ((i + 1) * LotsOfObjects.amount_of_disks) / (time.time() - start)
                itemspersec = LotsOfObjects.amount_of_disks / (time.time() - mstart)
                runtimes.append(itemspersec)
                self._print_progress('* machine {0}/{1} (run: {2} dps, avg: {3} dps)'.format(i + 1, int(LotsOfObjects.amount_of_machines), round(itemspersec, 2), round(avgitemspersec, 2)))
            runtimes.sort()
            print '\ncompleted ({0}s). min: {1} dps, max: {2} dps'.format(round(time.time() - tstart, 2), round(runtimes[1], 2), round(runtimes[-2], 2))

            print 'start full query on disk property'
            start = time.time()
            amount = DataList({'object': TestDisk,
                               'data': DataList.select.COUNT,
                               'query': {'type': DataList.where_operator.AND,
                                         'items': [('size', DataList.operator.GT, 100),
                                                   ('size', DataList.operator.LT, (LotsOfObjects.amount_of_disks - 1) * 100)]}}).data
            self.assertEqual(amount, (LotsOfObjects.amount_of_disks - 3) * LotsOfObjects.amount_of_machines, 'Incorrect amount of disks. Found {0} instead of {1}'.format(amount, int((LotsOfObjects.amount_of_disks - 3) * LotsOfObjects.amount_of_machines)))
            seconds_passed = (time.time() - start)
            print 'completed ({0}s) in {1} seconds (avg: {2} dps)'.format(round(time.time() - tstart, 2), round(seconds_passed, 2), round(LotsOfObjects.amount_of_machines * LotsOfObjects.amount_of_disks / seconds_passed, 2))

        clean_data = True
        if clean_data:
            print 'cleaning up'
            start = time.time()
            runtimes = []
            for i in xrange(0, int(LotsOfObjects.amount_of_machines)):
                mstart = time.time()
                machine = TestMachine(mguids[i])
                for disk in machine.disks:
                    disk.delete()
                machine.delete()
                avgitemspersec = ((i + 1) * LotsOfObjects.amount_of_disks) / (time.time() - start)
                itemspersec = LotsOfObjects.amount_of_disks / (time.time() - mstart)
                runtimes.append(itemspersec)
                self._print_progress('* machine {0}/{1} (run: {2} dps, avg: {3} dps)'.format(i + 1, int(LotsOfObjects.amount_of_machines), round(itemspersec, 2), round(avgitemspersec, 2)))
            runtimes.sort()
            print '\ncompleted ({0}s). min: {1} dps, max: {2} dps'.format(round(time.time() - tstart, 2), round(runtimes[1], 2), round(runtimes[-2], 2))
开发者ID:JasperLue,项目名称:openvstorage,代码行数:84,代码来源:test_performance.py


注:本文中的ovs.dal.hybrids.t_testdisk.TestDisk.machine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。