fix(性能测试): 修复停止测试之后报告的缓存
This commit is contained in:
parent
3c95beec2d
commit
bc6fd9c6e0
|
@ -133,6 +133,7 @@ import MsPerformanceReportExport from "./PerformanceReportExport";
|
||||||
import {Message} from "element-ui";
|
import {Message} from "element-ui";
|
||||||
import SameTestReports from "@/business/components/performance/report/components/SameTestReports";
|
import SameTestReports from "@/business/components/performance/report/components/SameTestReports";
|
||||||
import MonitorCard from "@/business/components/performance/report/components/MonitorCard";
|
import MonitorCard from "@/business/components/performance/report/components/MonitorCard";
|
||||||
|
import {LIST_CHANGE, PerformanceEvent} from "@/business/components/common/head/ListEvent";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -264,6 +265,8 @@ export default {
|
||||||
this.result = this.$get('/performance/stop/' + this.reportId + '/' + forceStop, () => {
|
this.result = this.$get('/performance/stop/' + this.reportId + '/' + forceStop, () => {
|
||||||
this.$success(this.$t('report.test_stop_success'));
|
this.$success(this.$t('report.test_stop_success'));
|
||||||
if (forceStop) {
|
if (forceStop) {
|
||||||
|
// 发送广播,刷新 head 上的最新列表
|
||||||
|
PerformanceEvent.$emit(LIST_CHANGE);
|
||||||
this.$router.push('/performance/report/all');
|
this.$router.push('/performance/report/all');
|
||||||
this.websocket.close();
|
this.websocket.close();
|
||||||
} else {
|
} else {
|
||||||
|
@ -281,6 +284,7 @@ export default {
|
||||||
this.result = this.$post('/performance/run', {id: testId, triggerMode: 'MANUAL'}, (response) => {
|
this.result = this.$post('/performance/run', {id: testId, triggerMode: 'MANUAL'}, (response) => {
|
||||||
this.reportId = response.data;
|
this.reportId = response.data;
|
||||||
this.$router.push({path: '/performance/report/view/' + this.reportId});
|
this.$router.push({path: '/performance/report/view/' + this.reportId});
|
||||||
|
this.clearData();
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
});
|
});
|
||||||
|
|
|
@ -288,8 +288,9 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let threadGroups = [];
|
let threadGroups = [];
|
||||||
this.result = this.$get('/performance/report/get-jmx-content/' + this.report.id, (response) => {
|
this.result = this.$get('/performance/report/get-jmx-content/' + this.report.id)
|
||||||
let d = response.data;
|
.then((response) => {
|
||||||
|
let d = response.data.data;
|
||||||
threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name));
|
threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name));
|
||||||
threadGroups.forEach(tg => {
|
threadGroups.forEach(tg => {
|
||||||
tg.options = {};
|
tg.options = {};
|
||||||
|
@ -299,8 +300,9 @@ export default {
|
||||||
|
|
||||||
// 兼容数据
|
// 兼容数据
|
||||||
if (!threadGroups || threadGroups.length === 0) {
|
if (!threadGroups || threadGroups.length === 0) {
|
||||||
this.result = this.$get('/performance/get-jmx-content/' + this.report.testId, (response) => {
|
this.result = this.$get('/performance/get-jmx-content/' + this.report.testId)
|
||||||
response.data.forEach(d => {
|
.then((response) => {
|
||||||
|
response.data.data.forEach(d => {
|
||||||
threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name));
|
threadGroups = threadGroups.concat(findThreadGroup(d.jmx, d.name));
|
||||||
threadGroups.forEach(tg => {
|
threadGroups.forEach(tg => {
|
||||||
tg.options = {};
|
tg.options = {};
|
||||||
|
@ -308,9 +310,11 @@ export default {
|
||||||
this.threadGroups = threadGroups;
|
this.threadGroups = threadGroups;
|
||||||
this.getLoadConfig();
|
this.getLoadConfig();
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}).catch(() => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
calculateTotalChart() {
|
calculateTotalChart() {
|
||||||
|
|
Loading…
Reference in New Issue