diff --git a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue
index 2bb2c72f74..601b8a404f 100644
--- a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue
+++ b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue
@@ -206,7 +206,7 @@
-
+
@@ -734,6 +735,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;
@@ -744,6 +747,10 @@ export default {
}
}
+ if (tg.strategy === "specify") {
+ this.specifyNodeChange(tg);
+ }
+
if (!tg.threadNumber || !tg.duration
|| !tg.rampUpTime || !tg.step || !tg.iterateNum) {
this.$warning(this.$t('load_test.pressure_config_params_is_empty'));
@@ -774,6 +781,24 @@ 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('load_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/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js
index c6d3424371..d631d84c7c 100644
--- a/frontend/src/i18n/en-US.js
+++ b/frontend/src/i18n/en-US.js
@@ -1108,6 +1108,7 @@ export default {
stoptest: 'Stop test',
stoptestnow: 'Stop the test immediately',
batch_delete_confirm: "Confirm batch delete performance test",
+ max_current_threads_tips: 'Exceeded the maximum concurrent number of this node {0}',
report: {
diff: "Compare",
set_default: 'Set to Default',
diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js
index bd4b96d954..7c051ea6cd 100644
--- a/frontend/src/i18n/zh-CN.js
+++ b/frontend/src/i18n/zh-CN.js
@@ -1113,6 +1113,7 @@ export default {
stoptest: '停止测试',
stoptestnow: '立即停止测试',
batch_delete_confirm: "确认批量删除性能测试",
+ max_current_threads_tips: '超出此节点{0}最大并发数',
report: {
diff: "对比",
set_default: '恢复默认',
diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js
index 9a6d28cc85..c14ed3649e 100644
--- a/frontend/src/i18n/zh-TW.js
+++ b/frontend/src/i18n/zh-TW.js
@@ -1113,6 +1113,7 @@ export default {
stoptest: '停止測試',
stoptestnow: '立即停止測試',
batch_delete_confirm: "确认批量删除性能测试",
+ max_current_threads_tips: '超出此節點{0}最大並發數',
report: {
diff: "對比",
set_default: '恢復默認',