refactor(测试计划): 优化测试计划并发执行快速生成测试计划报告

This commit is contained in:
fit2-zhao 2022-02-23 15:00:46 +08:00 committed by fit2-zhao
parent f7bc3afaa1
commit 6df644acbb
1 changed files with 27 additions and 20 deletions

View File

@ -21,6 +21,10 @@ public class ApiScenarioParallelService {
private JMeterService jMeterService;
public void parallel(Map<String, RunModeDataDTO> executeQueue, RunScenarioRequest request, String serialReportId, DBTestQueue executionQueue) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
Thread.currentThread().setName("SCENARIO-PARALLEL-THREAD");
for (String reportId : executeQueue.keySet()) {
RunModeDataDTO dataDTO = executeQueue.get(reportId);
JmeterRunRequestDTO runRequest = new JmeterRunRequestDTO(dataDTO.getTestId(), StringUtils.isNotEmpty(serialReportId) ? serialReportId : reportId, request.getRunMode(), null);
@ -43,4 +47,7 @@ public class ApiScenarioParallelService {
jMeterService.run(runRequest);
}
}
});
thread.start();
}
}