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)
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") 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)
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)