修改名称
This commit is contained in:
parent
1578a81d8f
commit
3b0e2c11b7
|
@ -24,7 +24,7 @@ import java.time.format.DateTimeFormatter;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class JtlResolver {
|
||||
public class GenerateReport {
|
||||
|
||||
private static final Integer ERRORS_TOP_SIZE = 5;
|
||||
private static final String DATE_TIME_PATTERN = "yyyy/MM/dd HH:mm:ss";
|
||||
|
@ -186,7 +186,7 @@ public class JtlResolver {
|
|||
}
|
||||
}
|
||||
|
||||
Map<String, List<Metric>> jtlMap = falseList.stream().collect(Collectors.groupingBy(JtlResolver::getResponseCodeAndFailureMessage));
|
||||
Map<String, List<Metric>> jtlMap = falseList.stream().collect(Collectors.groupingBy(GenerateReport::getResponseCodeAndFailureMessage));
|
||||
|
||||
for (Map.Entry<String, List<Metric>> next : jtlMap.entrySet()) {
|
||||
String key = next.getKey();
|
||||
|
@ -219,7 +219,7 @@ public class JtlResolver {
|
|||
.collect(Collectors.toList());
|
||||
|
||||
Map<String, List<Metric>> collect = falseList.stream()
|
||||
.collect(Collectors.groupingBy(JtlResolver::getResponseCodeAndFailureMessage));
|
||||
.collect(Collectors.groupingBy(GenerateReport::getResponseCodeAndFailureMessage));
|
||||
|
||||
for (Map.Entry<String, List<Metric>> next : collect.entrySet()) {
|
||||
String key = next.getKey();
|
||||
|
@ -270,9 +270,9 @@ public class JtlResolver {
|
|||
TestOverview testOverview = new TestOverview();
|
||||
DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
||||
|
||||
List<Metric> totalLineList = JtlResolver.resolver(jtlString);
|
||||
List<Metric> totalLineList = GenerateReport.resolver(jtlString);
|
||||
// todo 修改测试概览的数值
|
||||
List<Metric> totalLineList2 = JtlResolver.resolver(jtlString);
|
||||
List<Metric> totalLineList2 = GenerateReport.resolver(jtlString);
|
||||
// 时间戳转时间
|
||||
for (Metric metric : totalLineList2) {
|
||||
metric.setTimestamp(stampToDate(DATE_TIME_PATTERN, metric.getTimestamp()));
|
||||
|
@ -355,7 +355,7 @@ public class JtlResolver {
|
|||
|
||||
public static ReportTimeInfo getReportTimeInfo(String jtlString) {
|
||||
ReportTimeInfo reportTimeInfo = new ReportTimeInfo();
|
||||
List<Metric> totalLineList = JtlResolver.resolver(jtlString);
|
||||
List<Metric> totalLineList = GenerateReport.resolver(jtlString);
|
||||
|
||||
totalLineList.sort(Comparator.comparing(t0 -> Long.valueOf(t0.getTimestamp())));
|
||||
|
|
@ -11,7 +11,7 @@ import io.metersphere.controller.request.ReportRequest;
|
|||
import io.metersphere.dto.ReportDTO;
|
||||
import io.metersphere.engine.Engine;
|
||||
import io.metersphere.engine.EngineFactory;
|
||||
import io.metersphere.report.JtlResolver;
|
||||
import io.metersphere.report.GenerateReport;
|
||||
import io.metersphere.report.base.ChartsData;
|
||||
import io.metersphere.report.base.Errors;
|
||||
import io.metersphere.report.base.ReportTimeInfo;
|
||||
|
@ -90,7 +90,7 @@ public class ReportService {
|
|||
checkReportStatus(id);
|
||||
LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(id);
|
||||
String content = loadTestReport.getContent();
|
||||
RequestStatisticsDTO requestStatistics = JtlResolver.getRequestStatistics(content);
|
||||
RequestStatisticsDTO requestStatistics = GenerateReport.getRequestStatistics(content);
|
||||
return requestStatistics;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class ReportService {
|
|||
checkReportStatus(id);
|
||||
LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(id);
|
||||
String content = loadTestReport.getContent();
|
||||
List<Errors> errors = JtlResolver.getErrorsList(content);
|
||||
List<Errors> errors = GenerateReport.getErrorsList(content);
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ public class ReportService {
|
|||
checkReportStatus(id);
|
||||
LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(id);
|
||||
String content = loadTestReport.getContent();
|
||||
ErrorsTop5DTO errors = JtlResolver.getErrorsTop5DTO(content);
|
||||
ErrorsTop5DTO errors = GenerateReport.getErrorsTop5DTO(content);
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class ReportService {
|
|||
checkReportStatus(id);
|
||||
LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(id);
|
||||
String content = loadTestReport.getContent();
|
||||
TestOverview testOverview = JtlResolver.getTestOverview(content);
|
||||
TestOverview testOverview = GenerateReport.getTestOverview(content);
|
||||
return testOverview;
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ public class ReportService {
|
|||
checkReportStatus(id);
|
||||
LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(id);
|
||||
String content = loadTestReport.getContent();
|
||||
ReportTimeInfo reportTimeInfo = JtlResolver.getReportTimeInfo(content);
|
||||
ReportTimeInfo reportTimeInfo = GenerateReport.getReportTimeInfo(content);
|
||||
return reportTimeInfo;
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ public class ReportService {
|
|||
checkReportStatus(id);
|
||||
LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(id);
|
||||
String content = loadTestReport.getContent();
|
||||
List<ChartsData> chartsDataList = JtlResolver.getLoadChartData(content);
|
||||
List<ChartsData> chartsDataList = GenerateReport.getLoadChartData(content);
|
||||
return chartsDataList;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ public class ReportService {
|
|||
checkReportStatus(id);
|
||||
LoadTestReportWithBLOBs loadTestReport = loadTestReportMapper.selectByPrimaryKey(id);
|
||||
String content = loadTestReport.getContent();
|
||||
List<ChartsData> chartsDataList = JtlResolver.getResponseTimeChartData(content);
|
||||
List<ChartsData> chartsDataList = GenerateReport.getResponseTimeChartData(content);
|
||||
return chartsDataList;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue