From cfd7cc6348e46ce7a8a557907ee9b83cc0a86100 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 1 Dec 2022 16:05:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BA=E5=AE=9A=E8=8A=82=E7=82=B9=E6=88=96?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=88=86=E9=85=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=95=B0=E6=97=B6=E6=9C=80=E5=A4=A7=E5=B9=B6=E5=8F=91=E6=95=B0?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=99=90=E5=88=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020219 --user=刘瑞斌 [性能测试]github#20103性能测试设置完资源池中压力机的最大并发数,压测执行时,分配策略选固定节点、自定义策略 没限制住单个压力机的最大并发数 https://www.tapd.cn/55049933/s/1309593 Closes #20103 --- .../components/PerformancePressureConfig.vue | 27 ++++++++++++++++--- .../frontend/src/i18n/lang/en-US.js | 1 + .../frontend/src/i18n/lang/zh-CN.js | 1 + .../frontend/src/i18n/lang/zh-TW.js | 1 + 4 files changed, 27 insertions(+), 3 deletions(-) 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: '沒有创建接口的權限無法執行同步', } }