diff --git a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue index 221b9a6c9e..bb23b7dadc 100644 --- a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue +++ b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue @@ -4,7 +4,7 @@ - + {{ $t('load_test.thread_num') }} {{ threadGroup.threadNumber }}, - {{$t('load_test.iterate_num')}} {{threadGroup.iterateNum}} + {{ $t('load_test.iterate_num') }} {{ threadGroup.iterateNum }} @@ -42,6 +42,7 @@ v-model="threadGroup.threadNumber" @change="calculateTotalChart(threadGroup)" :min="resourcePoolResourceLength" + :max="maxThreadNumbers" size="mini"/>
@@ -219,7 +220,8 @@ export default { resourcePools: [], activeNames: ["0"], threadGroups: [], - resourcePoolResourceLength: 1 + resourcePoolResourceLength: 1, + maxThreadNumbers: 5000, } }, mounted() { @@ -336,6 +338,22 @@ export default { }); } }, + resourcePoolChange() { + let result = this.resourcePools.filter(p => p.id === this.resourcePool); + if (result.length === 1) { + let threadNumber = 0; + result[0].resources.forEach(resource => { + threadNumber += JSON.parse(resource.configuration).maxConcurrency; + }) + this.maxThreadNumbers = threadNumber; + this.threadGroups.forEach(tg => { + if (tg.threadNumber > threadNumber) { + this.$set(tg, "threadNumber", threadNumber); + } + }) + this.calculateTotalChart(); + } + }, calculateTotalChart() { let handler = this; if (handler.duration < handler.rampUpTime) { @@ -344,6 +362,11 @@ export default { if (handler.rampUpTime < handler.step) { handler.step = handler.rampUpTime; } + // 线程数不能小于资源池节点的数量 + let resourcePool = this.resourcePools.filter(v => v.id === this.resourcePool)[0]; + if (resourcePool) { + this.resourcePoolResourceLength = resourcePool.resources.length; + } let color = ['#60acfc', '#32d3eb', '#5bc49f', '#feb64d', '#ff7c7c', '#9287e7', '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3']; handler.options = { color: color, @@ -649,7 +672,7 @@ export default { border-bottom: 1px solid #DCDFE6; } -/deep/ .el-collapse-item__content{ +/deep/ .el-collapse-item__content { padding-left: 10px; padding-bottom: 5px; border-left-width: 8px;