refactor(性能测试): 测试计划调整参数后计算粒度修改
This commit is contained in:
parent
4091dc8fff
commit
f6a3b4d8dc
|
@ -826,13 +826,12 @@ public class PerformanceTestService {
|
||||||
Integer granularity = CommonBeanFactory.getBean(JmeterProperties.class).getReport().getGranularity();
|
Integer granularity = CommonBeanFactory.getBean(JmeterProperties.class).getReport().getGranularity();
|
||||||
try {
|
try {
|
||||||
LoadTestReportWithBLOBs report = loadTestReportMapper.selectByPrimaryKey(reportId);
|
LoadTestReportWithBLOBs report = loadTestReportMapper.selectByPrimaryKey(reportId);
|
||||||
LoadTestWithBLOBs loadTest = loadTestMapper.selectByPrimaryKey(report.getTestId());
|
JSONObject advancedConfig = JSON.parseObject(report.getAdvancedConfiguration());
|
||||||
JSONObject advancedConfig = JSON.parseObject(loadTest.getAdvancedConfiguration());
|
|
||||||
if (advancedConfig.getInteger("granularity") != null) {
|
if (advancedConfig.getInteger("granularity") != null) {
|
||||||
return advancedConfig.getInteger("granularity") * 1000;// 单位是ms
|
return advancedConfig.getInteger("granularity") * 1000;// 单位是ms
|
||||||
}
|
}
|
||||||
AtomicReference<Integer> maxDuration = new AtomicReference<>(0);
|
AtomicReference<Integer> maxDuration = new AtomicReference<>(0);
|
||||||
List<List<JSONObject>> pressureConfigLists = JSON.parseObject(loadTest.getLoadConfiguration(), new TypeReference<List<List<JSONObject>>>() {
|
List<List<JSONObject>> pressureConfigLists = JSON.parseObject(report.getLoadConfiguration(), new TypeReference<List<List<JSONObject>>>() {
|
||||||
});
|
});
|
||||||
// 按照最长的执行时间来确定
|
// 按照最长的执行时间来确定
|
||||||
pressureConfigLists.forEach(pcList -> {
|
pressureConfigLists.forEach(pcList -> {
|
||||||
|
|
Loading…
Reference in New Issue