提交 170b5bea 编写于 作者: S shiziyuan9527 提交者: 刘瑞斌

refactor(性能测试): K8S类型资源池报告不显示监控详情Tab

上级 0bd7d4aa
...@@ -111,6 +111,11 @@ public class PerformanceReportController { ...@@ -111,6 +111,11 @@ public class PerformanceReportController {
return reportService.getLoadTestReport(reportId); return reportService.getLoadTestReport(reportId);
} }
@GetMapping("/pool/type/{reportId}")
public String getPoolTypeByReportId(@PathVariable String reportId) {
return reportService.getPoolTypeByReportId(reportId);
}
@GetMapping("log/resource/{reportId}") @GetMapping("log/resource/{reportId}")
public List<LogDetailDTO> getResourceIds(@PathVariable String reportId) { public List<LogDetailDTO> getResourceIds(@PathVariable String reportId) {
return reportService.getReportLogResource(reportId); return reportService.getReportLogResource(reportId);
......
...@@ -59,6 +59,8 @@ public class ReportService { ...@@ -59,6 +59,8 @@ public class ReportService {
private FileService fileService; private FileService fileService;
@Resource @Resource
private SqlSessionFactory sqlSessionFactory; private SqlSessionFactory sqlSessionFactory;
@Resource
private TestResourcePoolMapper testResourcePoolMapper;
public List<ReportDTO> getRecentReportList(ReportRequest request) { public List<ReportDTO> getRecentReportList(ReportRequest request) {
List<OrderRequest> orders = new ArrayList<>(); List<OrderRequest> orders = new ArrayList<>();
...@@ -315,4 +317,18 @@ public class ReportService { ...@@ -315,4 +317,18 @@ public class ReportService {
} }
} }
} }
public String getPoolTypeByReportId(String reportId) {
LoadTestReportWithBLOBs report = getReport(reportId);
String testId = report.getTestId();
LoadTestWithBLOBs test = loadTestMapper.selectByPrimaryKey(testId);
if (test != null) {
String poolId = test.getTestResourcePoolId();
TestResourcePool testResourcePool = testResourcePoolMapper.selectByPrimaryKey(poolId);
if (testResourcePool != null) {
return testResourcePool.getType();
}
}
return "";
}
} }
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<el-tab-pane :label="$t('report.test_log_details')"> <el-tab-pane :label="$t('report.test_log_details')">
<ms-report-log-details :report="report"/> <ms-report-log-details :report="report"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="监控详情"> <el-tab-pane :label="$t('report.test_monitor_details')" v-if="poolType === 'NODE'">
<monitor-card :report="report"/> <monitor-card :report="report"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -169,7 +169,8 @@ export default { ...@@ -169,7 +169,8 @@ export default {
{value: '30', label: '30s'}, {value: '30', label: '30s'},
{value: '60', label: '1m'}, {value: '60', label: '1m'},
{value: '300', label: '5m'} {value: '300', label: '5m'}
] ],
poolType: ""
}; };
}, },
methods: { methods: {
...@@ -379,6 +380,14 @@ export default { ...@@ -379,6 +380,14 @@ export default {
} }
} }
localStorage.setItem("reportRefreshTime", this.refreshTime); localStorage.setItem("reportRefreshTime", this.refreshTime);
},
getPoolType(reportId) {
this.$get("/performance/report/pool/type/" + reportId, result => {
let data = result.data;
if (data) {
this.poolType = data;
}
})
} }
}, },
created() { created() {
...@@ -388,6 +397,7 @@ export default { ...@@ -388,6 +397,7 @@ export default {
} }
this.reportId = this.$route.path.split('/')[4]; this.reportId = this.$route.path.split('/')[4];
this.getReport(this.reportId); this.getReport(this.reportId);
this.getPoolType(this.reportId);
}, },
watch: { watch: {
'$route'(to) { '$route'(to) {
......
...@@ -441,6 +441,7 @@ export default { ...@@ -441,6 +441,7 @@ export default {
test_request_statistics: 'Test Request Statistics', test_request_statistics: 'Test Request Statistics',
test_error_log: 'Test Error Log', test_error_log: 'Test Error Log',
test_log_details: 'Test Log Details', test_log_details: 'Test Log Details',
test_monitor_details: 'Test Monitor Details',
test_details: 'Test Details', test_details: 'Test Details',
test_duration: 'Current Execution Time:{0} minutes {1} seconds', test_duration: 'Current Execution Time:{0} minutes {1} seconds',
test_start_time: 'Start Execution Time', test_start_time: 'Start Execution Time',
......
...@@ -448,6 +448,7 @@ export default { ...@@ -448,6 +448,7 @@ export default {
test_request_statistics: '请求统计', test_request_statistics: '请求统计',
test_error_log: '错误记录', test_error_log: '错误记录',
test_log_details: '日志详情', test_log_details: '日志详情',
test_monitor_details: '监控详情',
test_details: '测试详情', test_details: '测试详情',
test_duration: '当前执行时长:{0} 分钟 {1} 秒', test_duration: '当前执行时长:{0} 分钟 {1} 秒',
test_start_time: '开始执行时间', test_start_time: '开始执行时间',
......
...@@ -439,6 +439,7 @@ export default { ...@@ -439,6 +439,7 @@ export default {
test_request_statistics: '請求統計', test_request_statistics: '請求統計',
test_error_log: '錯誤記錄', test_error_log: '錯誤記錄',
test_log_details: '日誌詳情', test_log_details: '日誌詳情',
test_monitor_details: '監控詳情',
test_details: '測試詳情', test_details: '測試詳情',
test_duration: '當前執行時長:{0} 分鐘 {1} 秒', test_duration: '當前執行時長:{0} 分鐘 {1} 秒',
test_start_time: '開始執行時間', test_start_time: '開始執行時間',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册