预估图细节
This commit is contained in:
parent
695d1a9932
commit
c703a2f7f3
|
@ -52,6 +52,7 @@
|
||||||
<el-input-number
|
<el-input-number
|
||||||
placeholder=""
|
placeholder=""
|
||||||
:min="1"
|
:min="1"
|
||||||
|
:max="duration"
|
||||||
v-model="rampUpTime"
|
v-model="rampUpTime"
|
||||||
@change="calculateChart"
|
@change="calculateChart"
|
||||||
size="mini"/>
|
size="mini"/>
|
||||||
|
@ -63,6 +64,7 @@
|
||||||
<el-input-number
|
<el-input-number
|
||||||
placeholder=""
|
placeholder=""
|
||||||
:min="1"
|
:min="1"
|
||||||
|
:max="threadNumber"
|
||||||
v-model="step"
|
v-model="step"
|
||||||
@change="calculateChart"
|
@change="calculateChart"
|
||||||
size="mini"/>
|
size="mini"/>
|
||||||
|
@ -93,9 +95,9 @@
|
||||||
return {
|
return {
|
||||||
testPlan: {},
|
testPlan: {},
|
||||||
threadNumber: 10,
|
threadNumber: 10,
|
||||||
duration: 30,
|
duration: 10,
|
||||||
rampUpTime: 12,
|
rampUpTime: 10,
|
||||||
step: 4,
|
step: 10,
|
||||||
rpsLimit: 10,
|
rpsLimit: 10,
|
||||||
orgOptions: {},
|
orgOptions: {},
|
||||||
}
|
}
|
||||||
|
@ -104,6 +106,8 @@
|
||||||
let testId = this.$route.path.split('/')[2];
|
let testId = this.$route.path.split('/')[2];
|
||||||
if (testId) {
|
if (testId) {
|
||||||
this.getLoadConfig(testId);
|
this.getLoadConfig(testId);
|
||||||
|
} else {
|
||||||
|
this.calculateChart();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -111,6 +115,8 @@
|
||||||
let testId = to.path.split('/')[2];
|
let testId = to.path.split('/')[2];
|
||||||
if (testId) {
|
if (testId) {
|
||||||
this.getLoadConfig(testId);
|
this.getLoadConfig(testId);
|
||||||
|
} else {
|
||||||
|
this.calculateChart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -153,6 +159,9 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
calculateChart() {
|
calculateChart() {
|
||||||
|
if (this.duration < this.rampUpTime) {
|
||||||
|
this.rampUpTime = this.duration;
|
||||||
|
}
|
||||||
this.orgOptions = {
|
this.orgOptions = {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
|
@ -164,18 +173,21 @@
|
||||||
series: [{
|
series: [{
|
||||||
data: [],
|
data: [],
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
step: 'start',
|
||||||
|
smooth: false,
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
let timePeriod = Math.ceil(this.rampUpTime / this.step);
|
let timePeriod = Math.ceil(this.rampUpTime / this.step);
|
||||||
let threadPeriod = Math.ceil(this.threadNumber / this.step);
|
let threadPeriod = Math.ceil(this.threadNumber / this.step);
|
||||||
let inc = threadPeriod;
|
let threadInc = threadPeriod;
|
||||||
|
let timeInc = timePeriod;
|
||||||
|
|
||||||
for (let i = 0; i < this.duration; i++) {
|
for (let i = 0; i < this.duration; i++) {
|
||||||
// x 轴
|
// x 轴
|
||||||
this.orgOptions.xAxis.data.push(i);
|
this.orgOptions.xAxis.data.push(i);
|
||||||
if (i > timePeriod) {
|
if (i > timePeriod) {
|
||||||
threadPeriod = threadPeriod + inc;
|
threadPeriod = threadPeriod + threadInc;
|
||||||
timePeriod += timePeriod;
|
timePeriod += timeInc;
|
||||||
if (threadPeriod > this.threadNumber) {
|
if (threadPeriod > this.threadNumber) {
|
||||||
threadPeriod = this.threadNumber;
|
threadPeriod = this.threadNumber;
|
||||||
}
|
}
|
||||||
|
@ -184,6 +196,9 @@
|
||||||
this.orgOptions.series[0].data.push(threadPeriod);
|
this.orgOptions.series[0].data.push(threadPeriod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
this.orgOptions.xAxis.data.push(this.duration);
|
||||||
|
this.orgOptions.series[0].data.push(this.threadNumber);
|
||||||
},
|
},
|
||||||
convertProperty() {
|
convertProperty() {
|
||||||
/// todo:下面4个属性是jmeter ConcurrencyThreadGroup plugin的属性,这种硬编码不太好吧,在哪能转换这种属性?
|
/// todo:下面4个属性是jmeter ConcurrencyThreadGroup plugin的属性,这种硬编码不太好吧,在哪能转换这种属性?
|
||||||
|
|
Loading…
Reference in New Issue