revert(性能测试): 回退关于测试执行时间的修改

This commit is contained in:
Captain.B 2021-04-04 14:21:43 +08:00 committed by 刘瑞斌
parent d59d4b5fca
commit 1a8a6c779f
2 changed files with 0 additions and 45 deletions

View File

@ -601,8 +601,6 @@ public class JmeterDocumentParser implements DocumentParser {
collectionProp.appendChild(createKafkaProp(document, "test.name", context.getTestName())); collectionProp.appendChild(createKafkaProp(document, "test.name", context.getTestName()));
collectionProp.appendChild(createKafkaProp(document, "test.startTime", context.getStartTime().toString())); collectionProp.appendChild(createKafkaProp(document, "test.startTime", context.getStartTime().toString()));
collectionProp.appendChild(createKafkaProp(document, "test.reportId", context.getReportId())); collectionProp.appendChild(createKafkaProp(document, "test.reportId", context.getReportId()));
collectionProp.appendChild(createKafkaProp(document, "test.expectedDuration", duration));// ms
collectionProp.appendChild(createKafkaProp(document, "test.expectedDelayEndTime", kafkaProperties.getExpectedDelayEndTime())); // 30s
elementProp.appendChild(collectionProp); elementProp.appendChild(collectionProp);
// set elementProp // set elementProp

View File

@ -180,7 +180,6 @@ import {findThreadGroup} from "@/business/components/performance/test/model/Thre
const HANDLER = "handler"; const HANDLER = "handler";
const THREAD_GROUP_TYPE = "tgType"; const THREAD_GROUP_TYPE = "tgType";
const EXPECTED_DURATION = "expectedDuration";
const SERIALIZE_THREAD_GROUPS = "serializeThreadGroups"; const SERIALIZE_THREAD_GROUPS = "serializeThreadGroups";
const TARGET_LEVEL = "TargetLevel"; const TARGET_LEVEL = "TargetLevel";
const RAMP_UP = "RampUp"; const RAMP_UP = "RampUp";
@ -648,50 +647,9 @@ export default {
} }
return this.$t('schedule.cron.seconds'); return this.$t('schedule.cron.seconds');
}, },
calculateDuration() {
let expectedDuration = 0;
for (let i = 0; i < this.threadGroups.length; i++) {
if (this.serializeThreadGroups) {
switch (this.threadGroups[i].unit) {
case "S":
expectedDuration += this.threadGroups[i].duration;
break;
case "M":
expectedDuration += this.threadGroups[i].duration * 60;
break;
case "H":
expectedDuration += this.threadGroups[i].duration * 60 * 60;
break;
default:
break;
}
} else {
let tmp = 0;
switch (this.threadGroups[i].unit) {
case "S":
tmp = this.threadGroups[i].duration;
break;
case "M":
tmp = this.threadGroups[i].duration * 60;
break;
case "H":
tmp = this.threadGroups[i].duration * 60 * 60;
break;
default:
break;
}
if (expectedDuration < tmp) {
expectedDuration = tmp;
}
}
}
return expectedDuration;
},
convertProperty() { convertProperty() {
/// todo4jmeter ConcurrencyThreadGroup plugin /// todo4jmeter ConcurrencyThreadGroup plugin
let result = []; let result = [];
//
let expectedDuration = this.calculateDuration();
// //
for (let i = 0; i < this.threadGroups.length; i++) { for (let i = 0; i < this.threadGroups.length; i++) {
@ -711,7 +669,6 @@ export default {
{key: ENABLED, value: this.threadGroups[i].enabled}, {key: ENABLED, value: this.threadGroups[i].enabled},
{key: DELETED, value: this.threadGroups[i].deleted}, {key: DELETED, value: this.threadGroups[i].deleted},
{key: THREAD_GROUP_TYPE, value: this.threadGroups[i].tgType}, {key: THREAD_GROUP_TYPE, value: this.threadGroups[i].tgType},
{key: EXPECTED_DURATION, value: expectedDuration},
{key: SERIALIZE_THREAD_GROUPS, value: this.serializeThreadGroups}, {key: SERIALIZE_THREAD_GROUPS, value: this.serializeThreadGroups},
]); ]);
} }