fix(性能测试): 修复多个线程组开启了rpslimit时报数组越界
This commit is contained in:
parent
8429add30e
commit
6e6a98fbd6
|
@ -880,6 +880,24 @@ public class JmeterDocumentParser implements DocumentParser {
|
|||
}
|
||||
|
||||
private void processVariableThroughputTimer(Element variableThroughputTimer) {
|
||||
Object durations = context.getProperty("duration");
|
||||
Integer duration;
|
||||
if (durations instanceof List) {
|
||||
Object o = ((List<?>) durations).get(0);
|
||||
duration = (Integer) o;
|
||||
((List<?>) durations).remove(0);
|
||||
} else {
|
||||
duration = (Integer) durations;
|
||||
}
|
||||
Object rpsLimits = context.getProperty("rpsLimit");
|
||||
String rpsLimit;
|
||||
if (rpsLimits instanceof List) {
|
||||
Object o = ((List<?>) rpsLimits).get(0);
|
||||
((List<?>) rpsLimits).remove(0);
|
||||
rpsLimit = o.toString();
|
||||
} else {
|
||||
rpsLimit = rpsLimits.toString();
|
||||
}
|
||||
if (variableThroughputTimer.getChildNodes().getLength() > 0) {
|
||||
final NodeList childNodes = variableThroughputTimer.getChildNodes();
|
||||
for (int i = 0; i < childNodes.getLength(); i++) {
|
||||
|
@ -905,27 +923,9 @@ public class JmeterDocumentParser implements DocumentParser {
|
|||
stringPropCount++;
|
||||
} else {
|
||||
stringPropCount = 0;
|
||||
Object durations = context.getProperty("duration");
|
||||
Integer duration;
|
||||
if (durations instanceof List) {
|
||||
Object o = ((List<?>) durations).get(0);
|
||||
duration = (Integer) o;
|
||||
((List<?>) durations).remove(0);
|
||||
} else {
|
||||
duration = (Integer) durations;
|
||||
}
|
||||
prop.getFirstChild().setNodeValue(String.valueOf(duration));
|
||||
continue;
|
||||
}
|
||||
Object rpsLimits = context.getProperty("rpsLimit");
|
||||
String rpsLimit;
|
||||
if (rpsLimits instanceof List) {
|
||||
Object o = ((List<?>) rpsLimits).get(0);
|
||||
((List<?>) rpsLimits).remove(0);
|
||||
rpsLimit = o.toString();
|
||||
} else {
|
||||
rpsLimit = rpsLimits.toString();
|
||||
}
|
||||
prop.getFirstChild().setNodeValue(rpsLimit);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue