refactor(性能测试): 将压测时间单位改为秒

This commit is contained in:
Captain.B 2020-11-19 10:08:54 +08:00
parent 7d1f976905
commit 8429add30e
5 changed files with 24 additions and 14 deletions

View File

@ -785,7 +785,9 @@ public class JmeterDocumentParser implements DocumentParser {
threadGroup.appendChild(createStringProp(document, "LogFilename", ""));
// bzm - Concurrency Thread Group "Thread Iterations Limit:" 设置为空
// threadGroup.appendChild(createStringProp(document, "Iterations", "1"));
threadGroup.appendChild(createStringProp(document, "Unit", "M"));
// threadGroup.appendChild(createStringProp(document, "Unit", "M"));
// 单位改成秒
threadGroup.appendChild(createStringProp(document, "Unit", "S"));
}
private void processCheckoutTimer(Element element) {
@ -903,7 +905,7 @@ public class JmeterDocumentParser implements DocumentParser {
stringPropCount++;
} else {
stringPropCount = 0;
Object durations = context.getProperty("duration");// 传入的是分钟数, 需要转化成秒数
Object durations = context.getProperty("duration");
Integer duration;
if (durations instanceof List) {
Object o = ((List<?>) durations).get(0);
@ -912,7 +914,7 @@ public class JmeterDocumentParser implements DocumentParser {
} else {
duration = (Integer) durations;
}
prop.getFirstChild().setNodeValue(String.valueOf(duration * 60));
prop.getFirstChild().setNodeValue(String.valueOf(duration));
continue;
}
Object rpsLimits = context.getProperty("rpsLimit");

View File

@ -191,7 +191,11 @@ export default {
this.threadGroups[i].rampUpTime = item.value;
break;
case DURATION:
this.threadGroups[i].duration = item.value;
if (item.unit) {
this.threadGroups[i].duration = item.value;
} else {
this.threadGroups[i].duration = item.value * 60;
}
break;
case STEPS:
this.threadGroups[i].step = item.value;
@ -216,7 +220,11 @@ export default {
this.threadGroups[0].rampUpTime = d.value;
break;
case DURATION:
this.threadGroups[0].duration = d.value;
if (d.unit) {
this.threadGroups[0].duration = d.value;
} else {
this.threadGroups[0].duration = d.value * 60;
}
break;
case STEPS:
this.threadGroups[0].step = d.value;
@ -468,7 +476,7 @@ export default {
{key: TARGET_LEVEL, value: this.threadGroups[i].threadNumber},
{key: RAMP_UP, value: this.threadGroups[i].rampUpTime},
{key: STEPS, value: this.threadGroups[i].step},
{key: DURATION, value: this.threadGroups[i].duration},
{key: DURATION, value: this.threadGroups[i].duration, unit: 'S'},
{key: RPS_LIMIT, value: this.threadGroups[i].rpsLimit},
{key: RPS_LIMIT_ENABLE, value: this.threadGroups[i].rpsLimitEnable},
{key: HOLD, value: this.threadGroups[i].duration - this.threadGroups[i].rampUpTime},

View File

@ -414,12 +414,12 @@ export default {
delete_file: "The file already exists, please delete the file with the same name first!",
thread_num: 'Concurrent users:',
input_thread_num: 'Please enter the number of threads',
duration: 'Duration time (minutes):',
duration: 'Duration time (seconds):',
input_duration: 'Please enter a duration',
rps_limit: 'RPS Limit:',
input_rps_limit: 'Please enter a limit',
ramp_up_time_within: 'In',
ramp_up_time_minutes: 'minutes, separate',
ramp_up_time_minutes: 'seconds, separate',
ramp_up_time_times: 'add concurrent users',
advanced_config_error: 'Advanced configuration verification failed',
domain_bind: 'Domain bind',
@ -1104,7 +1104,7 @@ export default {
performance: "Number of performance tests",
resource_pool: "Available test resource pool",
max_threads: "Maximum Concurrency",
duration: "Stress test duration(minutes)",
duration: "Stress test duration(seconds)",
use_default: "Use default quota",
yes: "Yes",
no: "No",

View File

@ -412,12 +412,12 @@ export default {
delete_file: "文件已存在,请先删除同名文件!",
thread_num: '并发用户数:',
input_thread_num: '请输入线程数',
duration: '压测时长(分钟',
duration: '压测时长(',
input_duration: '请输入时长',
rps_limit: 'RPS上限',
input_rps_limit: '请输入限制',
ramp_up_time_within: '在',
ramp_up_time_minutes: '分钟内,分',
ramp_up_time_minutes: '内,分',
ramp_up_time_times: '次增加并发用户',
advanced_config_error: '高级配置校验失败',
domain_bind: '域名绑定',
@ -1105,7 +1105,7 @@ export default {
performance: "性能测试数量",
resource_pool: "可用测试资源池",
max_threads: "最大并发数",
duration: "压测时长(分钟",
duration: "压测时长(",
use_default: "使用默认配额",
yes: "是",
no: "否",

View File

@ -414,12 +414,12 @@ export default {
delete_file: "文件已存在,請先刪除同名文件!",
thread_num: '並發用戶數:',
input_thread_num: '請輸入線程數',
duration: '壓測時長(分鐘',
duration: '壓測時長(',
input_duration: '請輸入時長',
rps_limit: 'RPS上限',
input_rps_limit: '請輸入限制',
ramp_up_time_within: '在',
ramp_up_time_minutes: '分鐘內,分',
ramp_up_time_minutes: '內,分',
ramp_up_time_times: '次增加並發用戶',
advanced_config_error: '高級配置校驗失敗',
domain_bind: '域名綁定',