parent
70985ffdef
commit
ddc57ba3ca
|
@ -1,65 +0,0 @@
|
|||
@@ -0,0 +1,64 @@
|
||||
package org.bench4q.agent.scenario;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bench4q.share.models.agent.scriptrecord.ScheduleModel;
|
||||
import org.bench4q.share.models.agent.scriptrecord.ScheduleModel.PointModel;
|
||||
|
||||
public class TestSchedule {
|
||||
private List<Segment> points;
|
||||
|
||||
public List<Segment> getPoints() {
|
||||
return points;
|
||||
}
|
||||
|
||||
public void setPoints(List<Segment> points) {
|
||||
this.points = points;
|
||||
}
|
||||
|
||||
public static class Segment {
|
||||
private final Point start;
|
||||
private final Point end;
|
||||
private final int growthUnit;
|
||||
|
||||
public Segment(Point startPoint, Point endPoint) {
|
||||
this.start = new Point(startPoint.time, startPoint.load);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Point {
|
||||
private final int time;
|
||||
private final int load;
|
||||
|
||||
public int getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public int getLoad() {
|
||||
return load;
|
||||
}
|
||||
|
||||
public Point(int time, int load) {
|
||||
// TODO Auto-generated constructor stub
|
||||
this.time = time;
|
||||
this.load = load;
|
||||
}
|
||||
}
|
||||
|
||||
public static TestSchedule build(TestScheduleModel scheduleModel) {
|
||||
TestSchedule schedule = new TestSchedule();
|
||||
schedule.setPoints(extractPoints(scheduleModel.getPoints()));
|
||||
return null;
|
||||
}
|
||||
|
||||
private static List<Point> extractPoints(List<PointModel> points) {
|
||||
List<Point> result = new LinkedList<TestSchedule.Point>();
|
||||
for (PointModel model : points) {
|
||||
result.add(new Point(model.getTime(), model.getLoad()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue