fix(性能测试): 修复停止测试之后报告的缓存

This commit is contained in:
Captain.B 2021-05-24 18:49:12 +08:00 committed by 刘瑞斌
parent 3c95beec2d
commit bc6fd9c6e0
2 changed files with 41 additions and 33 deletions

View File

@ -133,6 +133,7 @@ import MsPerformanceReportExport from "./PerformanceReportExport";
import {Message} from "element-ui";
import SameTestReports from "@/business/components/performance/report/components/SameTestReports";
import MonitorCard from "@/business/components/performance/report/components/MonitorCard";
import {LIST_CHANGE, PerformanceEvent} from "@/business/components/common/head/ListEvent";
export default {
@ -264,6 +265,8 @@ export default {
this.result = this.$get('/performance/stop/' + this.reportId + '/' + forceStop, () => {
this.$success(this.$t('report.test_stop_success'));
if (forceStop) {
// 广 head
PerformanceEvent.$emit(LIST_CHANGE);
this.$router.push('/performance/report/all');
this.websocket.close();
} else {
@ -281,6 +284,7 @@ export default {
this.result = this.$post('/performance/run', {id: testId, triggerMode: 'MANUAL'}, (response) => {
this.reportId = response.data;
this.$router.push({path: '/performance/report/view/' + this.reportId});
this.clearData();
});
}).catch(() => {
});

View File

@ -288,8 +288,9 @@ export default {
return;
}
let threadGroups = [];
this.result = this.$get('/performance/report/get-jmx-content/' + this.report.id, (response) => {
let d = response.data;
this.result = this.$get('/performance/report/get-jmx-content/' + this.report.id)
.then((response) => {
let d = response.data.data;
threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name));
threadGroups.forEach(tg => {
tg.options = {};
@ -299,8 +300,9 @@ export default {
//
if (!threadGroups || threadGroups.length === 0) {
this.result = this.$get('/performance/get-jmx-content/' + this.report.testId, (response) => {
response.data.forEach(d => {
this.result = this.$get('/performance/get-jmx-content/' + this.report.testId)
.then((response) => {
response.data.data.forEach(d => {
threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name));
threadGroups.forEach(tg => {
tg.options = {};
@ -308,9 +310,11 @@ export default {
this.threadGroups = threadGroups;
this.getLoadConfig();
});
})
.catch(() => {
});
}
}).catch(() => {
});
},
calculateTotalChart() {