submit limitmodel of testplan
This commit is contained in:
parent
b4289bed3b
commit
18d7bf0fbb
|
@ -30,8 +30,6 @@ import org.bench4q.master.domain.service.TestResultSave;
|
|||
import org.bench4q.master.domain.valueobject.limitation.TestPlanObserver;
|
||||
import org.bench4q.master.domain.valueobject.transaction.impl.TestPlanLoadApplication;
|
||||
import org.bench4q.share.enums.master.TestPlanStatus;
|
||||
import org.bench4q.share.helper.MarshalHelper;
|
||||
import org.bench4q.share.models.monitor.LimitModel;
|
||||
|
||||
@Entity
|
||||
@Table(name = "testplan")
|
||||
|
@ -51,7 +49,7 @@ public class TestPlan implements IAggregate {
|
|||
private TestResultSave testResultSave;
|
||||
private TestPlanRepository repository;
|
||||
private boolean hasToStop;
|
||||
private LimitModel limitModel;
|
||||
private String limitModel;
|
||||
private List<TestPlanObserver> observers = new ArrayList<TestPlanObserver>();
|
||||
|
||||
@Id
|
||||
|
@ -265,10 +263,9 @@ public class TestPlan implements IAggregate {
|
|||
}
|
||||
//start monitor to check the limit
|
||||
UUID testPlanIdUuid = UUID.fromString(this.testPlanRunId);
|
||||
String limitModelString = MarshalHelper.tryMarshal(this.limitModel);
|
||||
if (getMonitors() != null) {
|
||||
for (Monitor monitor : getMonitors()) {
|
||||
monitor.start(testPlanIdUuid, limitModelString);
|
||||
monitor.start(testPlanIdUuid, this.limitModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -349,12 +346,12 @@ public class TestPlan implements IAggregate {
|
|||
this.hasToStop = hasToStop;
|
||||
}
|
||||
|
||||
@Transient
|
||||
public LimitModel getLimitModel() {
|
||||
@Column(name = "limitModel",columnDefinition = "LONGTEXT", nullable = true)
|
||||
public String getLimitModel() {
|
||||
return limitModel;
|
||||
}
|
||||
|
||||
public void setLimitModel(LimitModel limitModel) {
|
||||
public void setLimitModel(String limitModel) {
|
||||
this.limitModel = limitModel;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ import org.bench4q.share.models.master.MonitorModel;
|
|||
import org.bench4q.share.models.master.RunningScriptModel;
|
||||
import org.bench4q.share.models.master.TestPlanModel;
|
||||
import org.bench4q.share.models.master.statistics.ScriptResultModel;
|
||||
import org.bench4q.share.models.monitor.LimitModel;
|
||||
import org.bench4q.share.models.monitor.MonitorMain;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -142,7 +143,10 @@ public class TestPlanFactory {
|
|||
monitors.add(monitorInBusiness);
|
||||
}
|
||||
result.setMonitors(monitors);
|
||||
result.setLimitModel(testPlanModel.getLimitModel());
|
||||
LimitModel limitModel = testPlanModel.getLimitModel();
|
||||
if(limitModel != null){
|
||||
result.setLimitModel(MarshalHelper.tryMarshal(testPlanModel.getLimitModel()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,16 @@ function getPointModelList(allocation,chartPoint){
|
|||
return pointModelList;
|
||||
}
|
||||
function getLimitValue(){
|
||||
|
||||
var limitableFieldArray = $("#targetMode").find("input[class='load-config-input limitable-field']");
|
||||
var params = new Array();
|
||||
for(var i=0;i< limitableFieldArray.length;i++){
|
||||
var field = limitableFieldArray[i];
|
||||
var name = field.name;
|
||||
var value = field.value;
|
||||
var param = new ParameterModel(name,value);
|
||||
params.push(param);
|
||||
}
|
||||
return new LimitModel(params);
|
||||
}
|
||||
function start() {
|
||||
var scriptList = new Array();
|
||||
|
@ -113,6 +122,17 @@ function start() {
|
|||
//delete last |
|
||||
if(filterTypeMatches != "")
|
||||
filterTypeMatches = filterTypeMatches.substring(0,filterTypeMatches.length-1);
|
||||
|
||||
var selectMode = $('input[name="modeSelect"]:checked').val();
|
||||
var currentChart;
|
||||
var limitModel = null;
|
||||
if(selectMode == "custom mode"){
|
||||
currentChart = customChart;
|
||||
}else{
|
||||
currentChart = targetChart;
|
||||
//collect limit
|
||||
limitModel = getLimitValue();
|
||||
}
|
||||
var chartPoint = currentChart.options.series[0].data;
|
||||
//get schedule model by selected mode
|
||||
for ( var k = 0; k < input.length; k++){
|
||||
|
@ -120,8 +140,6 @@ function start() {
|
|||
scriptList.push(new ScriptModel(scriptIdList[k],scheduleModel ,isFilterTimer,filterTypeMatches));
|
||||
}
|
||||
|
||||
//collect limit
|
||||
var limitModel = getLimitValue();
|
||||
var name = $("#testConfigurationName").val();
|
||||
var testPlan = new TestPlanRequestModel(scriptList, ipList, name, limitModel);
|
||||
$.ajax({
|
||||
|
@ -159,7 +177,7 @@ function loadLimitableFields(){
|
|||
var tdNode2 = document.createElement("td");
|
||||
var inputNode = document.createElement("input");
|
||||
inputNode.setAttribute("name", script[j]);
|
||||
inputNode.setAttribute("class","load-config-input");
|
||||
inputNode.setAttribute("class","load-config-input limitable-field");
|
||||
inputNode.setAttribute("type","text");
|
||||
if(j%2){
|
||||
tdNode.appendChild(textNode);
|
||||
|
|
|
@ -81,7 +81,7 @@ function loadSchedulePlot() {
|
|||
options.series[0].data.push([ExecuteRange,RequireLoad]);
|
||||
}
|
||||
var chart = new Highcharts.Chart(options);
|
||||
currentChart = chart;
|
||||
customChart = chart;
|
||||
}
|
||||
|
||||
|
||||
|
@ -172,7 +172,7 @@ function loadSchedulePlot2() {
|
|||
}
|
||||
},
|
||||
series : [ {
|
||||
data : [[ 0 , 0 ]]
|
||||
data : []
|
||||
} ]
|
||||
};
|
||||
var InitialUsers = parseInt($('input[name="initial-users"]').val());
|
||||
|
@ -186,5 +186,5 @@ function loadSchedulePlot2() {
|
|||
}
|
||||
|
||||
var chart = new Highcharts.Chart(options);
|
||||
currentChart = chart;
|
||||
targetChart = chart;
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
var currentChart;
|
||||
var customChart;
|
||||
var targetChart;
|
||||
$(document).ready(function() {
|
||||
loadScripts();
|
||||
loadSchedulePlot();
|
||||
|
|
|
@ -162,7 +162,7 @@ body {
|
|||
class="load-config-input" type="text" value="10"
|
||||
onblur="loadSchedulePlot2();checkLoadConfig()" /></td>
|
||||
<td><input name="maximum-users"
|
||||
class="load-config-input" type="text" value="10"
|
||||
class="load-config-input" type="text" value="20"
|
||||
onblur="loadSchedulePlot2();checkLoadConfig()" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
Loading…
Reference in New Issue