This commit is contained in:
Captain.B 2020-07-03 11:06:08 +08:00
parent 74417e6bec
commit d991b698b5
1 changed files with 4 additions and 2 deletions

View File

@ -731,13 +731,15 @@ public class JmeterDocumentParser implements DocumentParser {
elementProp.setAttribute("name", "ThreadGroup.main_controller");
elementProp.setAttribute("elementType", "com.blazemeter.jmeter.control.VirtualUserController");
threadGroup.appendChild(elementProp);
// 持续时长
String duration = context.getProperty("duration").toString();
String rampUp = context.getProperty("RampUp").toString();
int realHold = Integer.parseInt(duration) - Integer.parseInt(rampUp);
threadGroup.appendChild(createStringProp(document, "ThreadGroup.on_sample_error", "continue"));
threadGroup.appendChild(createStringProp(document, "TargetLevel", "2"));
threadGroup.appendChild(createStringProp(document, "RampUp", "12"));
threadGroup.appendChild(createStringProp(document, "Steps", "2"));
threadGroup.appendChild(createStringProp(document, "Hold", duration));
threadGroup.appendChild(createStringProp(document, "Hold", String.valueOf(realHold)));
threadGroup.appendChild(createStringProp(document, "LogFilename", ""));
threadGroup.appendChild(createStringProp(document, "Iterations", "1"));
threadGroup.appendChild(createStringProp(document, "Unit", "M"));