fix: 修复阶段加压力的预计结束时间计算的bug

This commit is contained in:
Captain.B 2021-04-01 21:27:29 +08:00 committed by 刘瑞斌
parent 3f779d7837
commit 7b1ad66eb4
1 changed files with 11 additions and 1 deletions

View File

@ -824,12 +824,22 @@ public class JmeterDocumentParser implements DocumentParser {
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) {
case "M":
duration = String.valueOf(Long.parseLong(duration) * 60);
hold = String.valueOf(Long.parseLong(hold) * 60);
rampUp = String.valueOf(Long.parseLong(rampUp) * 60);
break;
case "H":
duration = String.valueOf(Long.parseLong(duration) * 60 * 60);
hold = String.valueOf(Long.parseLong(hold) * 60 * 60);
rampUp = String.valueOf(Long.parseLong(rampUp) * 60 * 60);
break;
@ -837,7 +847,7 @@ public class JmeterDocumentParser implements DocumentParser {
break;
}
// 处理预计结束时间
processExpectedEndTime(hold);
processExpectedEndTime(duration);
threadGroup.setAttribute("enabled", enabled);
if (BooleanUtils.toBoolean(deleted)) {