fix: 修复阶段加压力的预计结束时间计算的bug
This commit is contained in:
parent
3f779d7837
commit
7b1ad66eb4
|
@ -824,12 +824,22 @@ public class JmeterDocumentParser implements DocumentParser {
|
||||||
enabled = o.toString();
|
enabled = o.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object durations = context.getProperty("duration");
|
||||||
|
String duration = "2";
|
||||||
|
if (durations instanceof List) {
|
||||||
|
Object o = ((List<?>) durations).get(0);
|
||||||
|
((List<?>) durations).remove(0);
|
||||||
|
duration = o.toString();
|
||||||
|
}
|
||||||
|
|
||||||
switch (unit) {
|
switch (unit) {
|
||||||
case "M":
|
case "M":
|
||||||
|
duration = String.valueOf(Long.parseLong(duration) * 60);
|
||||||
hold = String.valueOf(Long.parseLong(hold) * 60);
|
hold = String.valueOf(Long.parseLong(hold) * 60);
|
||||||
rampUp = String.valueOf(Long.parseLong(rampUp) * 60);
|
rampUp = String.valueOf(Long.parseLong(rampUp) * 60);
|
||||||
break;
|
break;
|
||||||
case "H":
|
case "H":
|
||||||
|
duration = String.valueOf(Long.parseLong(duration) * 60 * 60);
|
||||||
hold = String.valueOf(Long.parseLong(hold) * 60 * 60);
|
hold = String.valueOf(Long.parseLong(hold) * 60 * 60);
|
||||||
rampUp = String.valueOf(Long.parseLong(rampUp) * 60 * 60);
|
rampUp = String.valueOf(Long.parseLong(rampUp) * 60 * 60);
|
||||||
break;
|
break;
|
||||||
|
@ -837,7 +847,7 @@ public class JmeterDocumentParser implements DocumentParser {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 处理预计结束时间
|
// 处理预计结束时间
|
||||||
processExpectedEndTime(hold);
|
processExpectedEndTime(duration);
|
||||||
|
|
||||||
threadGroup.setAttribute("enabled", enabled);
|
threadGroup.setAttribute("enabled", enabled);
|
||||||
if (BooleanUtils.toBoolean(deleted)) {
|
if (BooleanUtils.toBoolean(deleted)) {
|
||||||
|
|
Loading…
Reference in New Issue