refactor(性能测试): 开启异步方法处理测试结果

This commit is contained in:
Captain.B 2021-07-14 14:50:10 +08:00 committed by 刘瑞斌
parent d1b110d2db
commit 1e2b9fe2e8
2 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.PropertySource; import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication(exclude = { @SpringBootApplication(exclude = {
@ -23,6 +24,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
JmeterProperties.class JmeterProperties.class
}) })
@EnableScheduling @EnableScheduling
@EnableAsync(proxyTargetClass = true)
//@PropertySource(value = {"file:c:\\opt\\metersphere\\conf\\metersphere.properties"}, encoding = "UTF-8", ignoreResourceNotFound = true) //@PropertySource(value = {"file:c:\\opt\\metersphere\\conf\\metersphere.properties"}, encoding = "UTF-8", ignoreResourceNotFound = true)
@PropertySource(value = {"file:/opt/metersphere/conf/metersphere.properties"}, encoding = "UTF-8", ignoreResourceNotFound = true) @PropertySource(value = {"file:/opt/metersphere/conf/metersphere.properties"}, encoding = "UTF-8", ignoreResourceNotFound = true)
public class Application { public class Application {

View File

@ -1,7 +1,9 @@
package io.metersphere.commons.consumer; package io.metersphere.commons.consumer;
import io.metersphere.base.domain.LoadTestReport; import io.metersphere.base.domain.LoadTestReport;
import org.springframework.scheduling.annotation.Async;
public interface LoadTestFinishEvent { public interface LoadTestFinishEvent {
@Async
void execute(LoadTestReport loadTestReport); void execute(LoadTestReport loadTestReport);
} }