revert(性能测试): 回退关于测试执行时间的修改
This commit is contained in:
parent
d59d4b5fca
commit
1a8a6c779f
|
@ -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
|
||||||
|
|
|
@ -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() {
|
||||||
/// todo:下面4个属性是jmeter ConcurrencyThreadGroup plugin的属性,这种硬编码不太好吧,在哪能转换这种属性?
|
/// todo:下面4个属性是jmeter 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},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue