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


Python PBenchExecutor.get_load方法代码示例

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


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

示例1: test_schedule_concurrency_steps

# 需要导入模块: from bzt.modules.pbench import PBenchExecutor [as 别名]
# 或者: from bzt.modules.pbench.PBenchExecutor import get_load [as 别名]
 def test_schedule_concurrency_steps(self):
     executor = PBenchExecutor()
     executor.engine = EngineEmul()
     executor.execution.merge({"concurrency": 5, "ramp-up": 10, "steps": 3})
     obj = Scheduler(executor.get_load(), io.BytesIO(b("5 test1\ntest1\n5 test2\ntest2\n")), logging.getLogger(""))
     items = list(obj.generate())
     self.assertEqual(8, len(items))
     self.assertEqual(-1, items[5][0])  # instance became unlimited
     self.assertEqual(Scheduler.REC_TYPE_LOOP_START, items[6][5])  # looped payload
开发者ID:SanjeebJena,项目名称:taurus,代码行数:11,代码来源:test_pbench.py

示例2: test_schedule_empty

# 需要导入模块: from bzt.modules.pbench import PBenchExecutor [as 别名]
# 或者: from bzt.modules.pbench.PBenchExecutor import get_load [as 别名]
 def test_schedule_empty(self):
     executor = PBenchExecutor()
     executor.engine = EngineEmul()
     # concurrency: 1, iterations: 1
     obj = Scheduler(executor.get_load(), io.BytesIO(b("4 test\ntest\n")), logging.getLogger(""))
     items = list(obj.generate())
     for item in items:
         logging.debug("Item: %s", item)
     self.assertEqual(1, len(items))
开发者ID:SanjeebJena,项目名称:taurus,代码行数:11,代码来源:test_pbench.py

示例3: test_schedule_empty

# 需要导入模块: from bzt.modules.pbench import PBenchExecutor [as 别名]
# 或者: from bzt.modules.pbench.PBenchExecutor import get_load [as 别名]
 def test_schedule_empty(self):
     executor = PBenchExecutor()
     executor.engine = EngineEmul()
     try:
         obj = Scheduler(executor.get_load(), StringIO("4 test\ntest\n"), logging.getLogger(""))
         for item in obj.generate():
             logging.debug("Item: %s", item)
         self.fail()
     except NotImplementedError:
         pass
开发者ID:AlexeyDeyneko,项目名称:taurus,代码行数:12,代码来源:test_pbench.py

示例4: test_schedule_concurrency

# 需要导入模块: from bzt.modules.pbench import PBenchExecutor [as 别名]
# 或者: from bzt.modules.pbench.PBenchExecutor import get_load [as 别名]
 def test_schedule_concurrency(self):
     executor = PBenchExecutor()
     executor.engine = EngineEmul()
     executor.execution.merge({"concurrency": 5, "ramp-up": 10, "hold-for": 5})
     obj = Scheduler(executor.get_load(), StringIO("5 test1\ntest1\n5 test2\ntest2\n"), logging.getLogger(""))
     items = list(obj.generate())
     logging.debug("%s", items)
     self.assertEqual(8, len(items))
     self.assertEqual(-1, items[5][0])  # instance became unlimited
     self.assertEqual(1, items[6][5])  # looped payload
开发者ID:VegiS,项目名称:taurus,代码行数:12,代码来源:test_pbench.py

示例5: test_schedule_rps

# 需要导入模块: from bzt.modules.pbench import PBenchExecutor [as 别名]
# 或者: from bzt.modules.pbench.PBenchExecutor import get_load [as 别名]
        def test_schedule_rps(self):
            executor = PBenchExecutor()
            executor.engine = EngineEmul()
            executor.engine.config.merge({"provisioning": "test"})
            rps = 9
            rampup = 12
            executor.execution.merge({"throughput": rps, "ramp-up": rampup, "steps": 3, "hold-for": 0})
            obj = Scheduler(executor.get_load(), io.BytesIO(b("4 test\ntest\n")), logging.getLogger(""))

            cnt = 0
            cur = 0
            currps = 0
            for item in obj.generate():
                # logging.debug("Item: %s", item)
                if int(math.ceil(item[0])) != cur:
                    # self.assertLessEqual(currps, rps)
                    cur = int(math.ceil(item[0]))
                    logging.debug("RPS: %s", currps)
                    currps = 0

                cnt += 1
                currps += 1

            logging.debug("RPS: %s", currps)
开发者ID:SanjeebJena,项目名称:taurus,代码行数:26,代码来源:test_pbench.py

示例6: test_schedule_with_no_rampup

# 需要导入模块: from bzt.modules.pbench import PBenchExecutor [as 别名]
# 或者: from bzt.modules.pbench.PBenchExecutor import get_load [as 别名]
 def test_schedule_with_no_rampup(self):
     executor = PBenchExecutor()
     executor.engine = EngineEmul()
     executor.execution.merge({"concurrency": 10, "ramp-up": None, "steps": 3, "hold-for": 10})
     # this line shouln't throw an exception
     obj = Scheduler(executor.get_load(), io.BytesIO(b("4 test\ntest\n")), logging.getLogger(""))
开发者ID:SanjeebJena,项目名称:taurus,代码行数:8,代码来源:test_pbench.py

示例7: test_schedule_empty

# 需要导入模块: from bzt.modules.pbench import PBenchExecutor [as 别名]
# 或者: from bzt.modules.pbench.PBenchExecutor import get_load [as 别名]
 def test_schedule_empty(self):
     executor = PBenchExecutor()
     executor.engine = EngineEmul()
     obj = Scheduler(executor.get_load(), StringIO("4 test\ntest\n"), logging.getLogger(""))
     for item in obj.generate():
         logging.debug("Item: %s", item)
开发者ID:VegiS,项目名称:taurus,代码行数:8,代码来源:test_pbench.py


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