本文整理汇总了Python中bzt.jmx.JMX.get_concurrency_thread_group方法的典型用法代码示例。如果您正苦于以下问题:Python JMX.get_concurrency_thread_group方法的具体用法?Python JMX.get_concurrency_thread_group怎么用?Python JMX.get_concurrency_thread_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bzt.jmx.JMX
的用法示例。
在下文中一共展示了JMX.get_concurrency_thread_group方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: convert
# 需要导入模块: from bzt.jmx import JMX [as 别名]
# 或者: from bzt.jmx.JMX import get_concurrency_thread_group [as 别名]
def convert(self, group, target, load, concurrency):
"""
Convert a thread group to ThreadGroup/ConcurrencyThreadGroup for applying of load
"""
msg = "Converting %s (%s) to %s and apply load parameters"
self.log.debug(msg, group.gtype, group.get_testname(), target)
on_error = group.get_on_error()
if target == ThreadGroup.__name__:
new_group_element = JMX.get_thread_group(
concurrency=concurrency,
rampup=load.ramp_up,
hold=load.hold,
iterations=load.iterations,
testname=group.get_testname(),
on_error=on_error)
elif target == ConcurrencyThreadGroup.__name__:
new_group_element = JMX.get_concurrency_thread_group(
concurrency=concurrency,
rampup=load.ramp_up,
hold=load.hold,
steps=load.steps,
testname=group.get_testname(),
on_error=on_error)
else:
self.log.warning('Unsupported preferred thread group: %s', target)
return
group.element.getparent().replace(group.element, new_group_element)