diff --git a/backend/src/main/java/io/metersphere/report/JtlResolver.java b/backend/src/main/java/io/metersphere/report/GenerateReport.java similarity index 97% rename from backend/src/main/java/io/metersphere/report/JtlResolver.java rename to backend/src/main/java/io/metersphere/report/GenerateReport.java index 5e3b4d163e..870b4b6673 100644 --- a/backend/src/main/java/io/metersphere/report/JtlResolver.java +++ b/backend/src/main/java/io/metersphere/report/GenerateReport.java @@ -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> jtlMap = falseList.stream().collect(Collectors.groupingBy(JtlResolver::getResponseCodeAndFailureMessage)); + Map> jtlMap = falseList.stream().collect(Collectors.groupingBy(GenerateReport::getResponseCodeAndFailureMessage)); for (Map.Entry> next : jtlMap.entrySet()) { String key = next.getKey(); @@ -219,7 +219,7 @@ public class JtlResolver { .collect(Collectors.toList()); Map> collect = falseList.stream() - .collect(Collectors.groupingBy(JtlResolver::getResponseCodeAndFailureMessage)); + .collect(Collectors.groupingBy(GenerateReport::getResponseCodeAndFailureMessage)); for (Map.Entry> 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 totalLineList = JtlResolver.resolver(jtlString); + List totalLineList = GenerateReport.resolver(jtlString); // todo 修改测试概览的数值 - List totalLineList2 = JtlResolver.resolver(jtlString); + List 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 totalLineList = JtlResolver.resolver(jtlString); + List totalLineList = GenerateReport.resolver(jtlString); totalLineList.sort(Comparator.comparing(t0 -> Long.valueOf(t0.getTimestamp()))); diff --git a/backend/src/main/java/io/metersphere/service/ReportService.java b/backend/src/main/java/io/metersphere/service/ReportService.java index 38c2e88c92..a833a5a07a 100644 --- a/backend/src/main/java/io/metersphere/service/ReportService.java +++ b/backend/src/main/java/io/metersphere/service/ReportService.java @@ -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 = JtlResolver.getErrorsList(content); + List 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 chartsDataList = JtlResolver.getLoadChartData(content); + List 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 chartsDataList = JtlResolver.getResponseTimeChartData(content); + List chartsDataList = GenerateReport.getResponseTimeChartData(content); return chartsDataList; }