diff --git a/performance-test/frontend/src/business/test/components/PerformancePressureConfig.vue b/performance-test/frontend/src/business/test/components/PerformancePressureConfig.vue index 75d2cbdbf6..0f6534617d 100644 --- a/performance-test/frontend/src/business/test/components/PerformancePressureConfig.vue +++ b/performance-test/frontend/src/business/test/components/PerformancePressureConfig.vue @@ -206,7 +206,8 @@
- + @@ -706,6 +708,8 @@ export default { } if (tg.strategy === "custom") { + this.customNodeChange(tg); + let sum = tg.resourceNodes.map(n => n.ratio).reduce((total, curr) => { total += curr; return total; @@ -746,8 +750,25 @@ export default { return []; } }, + specifyNodeChange(threadGroup) { + this.$set(this, 'maxThreadNumbers', threadGroup.resourceNodes[threadGroup.resourceNodeIndex].maxConcurrency); + if (threadGroup.threadNumber > this.maxThreadNumbers) { + threadGroup.threadNumber = this.maxThreadNumbers; + } + this.calculateTotalChart(); + }, + customNodeChange(threadGroup) { + threadGroup.resourceNodes.forEach(node => { + if (node.ratio * threadGroup.threadNumber > node.maxConcurrency) { + setTimeout(() => { + this.$warning(this.$t('performance_test.max_current_threads_tips', [node.ip])); + }); + node.ratio = (node.maxConcurrency / threadGroup.threadNumber).toFixed(2); + } + }); + this.calculateTotalChart(); + }, convertProperty() { - /// todo:下面4个属性是jmeter ConcurrencyThreadGroup plugin的属性,这种硬编码不太好吧,在哪能转换这种属性? let result = []; // 再组织数据 diff --git a/performance-test/frontend/src/i18n/lang/en-US.js b/performance-test/frontend/src/i18n/lang/en-US.js index a6d622e6e9..99f1ea0ecf 100644 --- a/performance-test/frontend/src/i18n/lang/en-US.js +++ b/performance-test/frontend/src/i18n/lang/en-US.js @@ -8,6 +8,7 @@ const message = { test_duration: '{0} hours {1} minutes {2} seconds', test_duration_tips: 'Execution Time:{0} hours {1} minutes {2} seconds', }, + max_current_threads_tips: 'Exceeded the maximum concurrent number of this node {0}', sync_scenario_no_permission_tips: 'No permission to create the scenario cannot perform synchronization', } } diff --git a/performance-test/frontend/src/i18n/lang/zh-CN.js b/performance-test/frontend/src/i18n/lang/zh-CN.js index a1948a8e78..8e9fb9cec4 100644 --- a/performance-test/frontend/src/i18n/lang/zh-CN.js +++ b/performance-test/frontend/src/i18n/lang/zh-CN.js @@ -8,6 +8,7 @@ const message = { test_duration: '{0}时{1}分{2}秒', test_duration_tips: '执行时长:{0}时{1}分{2}秒', }, + max_current_threads_tips: '超出此节点{0}最大并发数', sync_scenario_no_permission_tips: '没有创建接口的权限无法执行同步', } } diff --git a/performance-test/frontend/src/i18n/lang/zh-TW.js b/performance-test/frontend/src/i18n/lang/zh-TW.js index b8b0911eb0..e2be5e51fe 100644 --- a/performance-test/frontend/src/i18n/lang/zh-TW.js +++ b/performance-test/frontend/src/i18n/lang/zh-TW.js @@ -8,6 +8,7 @@ const message = { test_duration: '{0}時{1}分{2}秒', test_duration_tips: '執行時長:{0}時{1}分{2}秒', }, + max_current_threads_tips: '超出此節點{0}最大並發數', sync_scenario_no_permission_tips: '沒有创建接口的權限無法執行同步', } }