parent
fc9222c104
commit
3c25415a9a
|
@ -24,7 +24,7 @@ public interface RunningScriptInterface {
|
||||||
|
|
||||||
public boolean stop();
|
public boolean stop();
|
||||||
|
|
||||||
public List<TestPlanScriptResult> doAfterRun(Date sampleTime);
|
public List<TestPlanScriptResult> sample(Date sampleTime);
|
||||||
|
|
||||||
public Date getStartTime();
|
public Date getStartTime();
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ public class TestPlan implements IAggregate {
|
||||||
List<Object> resultList = new LinkedList<Object>();
|
List<Object> resultList = new LinkedList<Object>();
|
||||||
for (TestPlanScript testPlanScript : getTestPlanScripts()) {
|
for (TestPlanScript testPlanScript : getTestPlanScripts()) {
|
||||||
List<TestPlanScriptResult> testPlanScriptResults = testPlanScript
|
List<TestPlanScriptResult> testPlanScriptResults = testPlanScript
|
||||||
.doAfterRun(sampleTime);
|
.sample(sampleTime);
|
||||||
if (testPlanScriptResults != null)
|
if (testPlanScriptResults != null)
|
||||||
resultList.addAll(testPlanScriptResults);
|
resultList.addAll(testPlanScriptResults);
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ public class TestPlanScript implements RunningScriptInterface {
|
||||||
.unmodifiableCollection(this.getRunningAgentsDB())));
|
.unmodifiableCollection(this.getRunningAgentsDB())));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TestPlanScriptResult> doAfterRun(Date sampleTime) {
|
public List<TestPlanScriptResult> sample(Date sampleTime) {
|
||||||
try {
|
try {
|
||||||
ScriptResultModel scriptResultModel = this.getSampler()
|
ScriptResultModel scriptResultModel = this.getSampler()
|
||||||
.getResultModelFromAgent();
|
.getResultModelFromAgent();
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class Test_TestResultSave extends TestBase_MakeUpTestPlan {
|
||||||
testPlan.getCurrentStatus());
|
testPlan.getCurrentStatus());
|
||||||
testPlanScript = getOneTestPlanScript(testPlan);
|
testPlanScript = getOneTestPlanScript(testPlan);
|
||||||
List<Object> resultList = new ArrayList<Object>();
|
List<Object> resultList = new ArrayList<Object>();
|
||||||
resultList.addAll(testPlanScript.doAfterRun(new Date()));
|
resultList.addAll(testPlanScript.sample(new Date()));
|
||||||
this.getTestResultSave().update(testPlan, resultList);
|
this.getTestResultSave().update(testPlan, resultList);
|
||||||
testPlanFromRepo = this.getTestPlanRepository().getTestPlanInDomainBy(
|
testPlanFromRepo = this.getTestPlanRepository().getTestPlanInDomainBy(
|
||||||
this.getTestPlanRunIdUuid());
|
this.getTestPlanRunIdUuid());
|
||||||
|
|
|
@ -39,12 +39,11 @@ public class ScheduleModel {
|
||||||
if (this.points.size() == 0) {
|
if (this.points.size() == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
long startTime = this.points.get(0).getTimeInSecond(), endTime = startTime;
|
long endTime = this.points.get(0).getTimeInSecond();
|
||||||
for (PointModel point : this.getPoints()) {
|
for (PointModel point : this.getPoints()) {
|
||||||
startTime = Math.min(point.getTimeInSecond(), startTime);
|
|
||||||
endTime = Math.max(point.getTimeInSecond(), endTime);
|
endTime = Math.max(point.getTimeInSecond(), endTime);
|
||||||
}
|
}
|
||||||
return endTime - startTime;
|
return endTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxLoad() {
|
public int getMaxLoad() {
|
||||||
|
|
Loading…
Reference in New Issue