diff --git a/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java b/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java index 0eeb8dc7a9..605486ce49 100644 --- a/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java +++ b/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java @@ -29,6 +29,7 @@ public class JmeterDocumentParser implements EngineSourceParser { private final static String COLLECTION_PROP = "collectionProp"; private final static String CONCURRENCY_THREAD_GROUP = "com.blazemeter.jmeter.threads.concurrency.ConcurrencyThreadGroup"; private final static String VARIABLE_THROUGHPUT_TIMER = "kg.apc.jmeter.timers.VariableThroughputTimer"; + private final static String RESULT_COLLECTOR = "ResultCollector"; private final static String THREAD_GROUP = "ThreadGroup"; private final static String POST_THREAD_GROUP = "PostThreadGroup"; private final static String SETUP_THREAD_GROUP = "SetupThreadGroup"; @@ -106,6 +107,9 @@ public class JmeterDocumentParser implements EngineSourceParser { processArgumentFiles(ele); } else if (nodeNameEquals(ele, KEYSTORE_CONFIG)) { processArgumentFiles(ele); + } else if (ele.getName().endsWith(RESULT_COLLECTOR)) { + // 处理结果收集器,性能测试不需要这些 + processResultCollector(ele); } } @@ -186,6 +190,13 @@ public class JmeterDocumentParser implements EngineSourceParser { } } + private void processResultCollector(Element element) { + Element hashTree = getNextSibling(element); + element.detach(); + hashTree.detach(); + } + + private void processArgumentFiles(Element element) { List childNodes = element.elements(); if (childNodes.size() == 0) {