diff --git a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java index 99c004e8f2..5a990dcd83 100644 --- a/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java +++ b/backend/src/main/java/io/metersphere/performance/parse/xml/reader/jmx/JmeterDocumentParser.java @@ -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"); diff --git a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue index d2efae530d..d94e02c8dc 100644 --- a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue +++ b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue @@ -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}, diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index ccde10042c..a8a0157b33 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -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", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index cc30f407bd..9e282ac46b 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -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: "否", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 156a949772..e36925782d 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -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: '域名綁定',