本文整理汇总了Python中bzt.jmx.JMX.get_thread_group方法的典型用法代码示例。如果您正苦于以下问题:Python JMX.get_thread_group方法的具体用法?Python JMX.get_thread_group怎么用?Python JMX.get_thread_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bzt.jmx.JMX
的用法示例。
在下文中一共展示了JMX.get_thread_group方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: convert
# 需要导入模块: from bzt.jmx import JMX [as 别名]
# 或者: from bzt.jmx.JMX import get_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)
示例2: __generate
# 需要导入模块: from bzt.jmx import JMX [as 别名]
# 或者: from bzt.jmx.JMX import get_thread_group [as 别名]
def __generate(self):
"""
Generate the test plan
"""
thread_group = JMX.get_thread_group(testname=self.executor.label)
thread_group_ht = etree.Element("hashTree", type="tg")
# NOTE: set realistic dns-cache and JVM prop by default?
self.request_compiler = RequestCompiler(self)
for element in self.compile_scenario(self.scenario):
thread_group_ht.append(element)
results_tree = self._get_results_tree()
results_tree_ht = etree.Element("hashTree")
self.append(self.TEST_PLAN_SEL, thread_group)
self.append(self.TEST_PLAN_SEL, thread_group_ht)
self.append(self.TEST_PLAN_SEL, results_tree)
self.append(self.TEST_PLAN_SEL, results_tree_ht)