start monitor in TestMonitorSampler

change LimitModel in monitor
This commit is contained in:
hmm 2014-09-25 13:40:43 +08:00
parent 18d7bf0fbb
commit 89b6e39e0c
3 changed files with 13 additions and 10 deletions

View File

@ -47,13 +47,7 @@ public class Monitor {
private Set<MonitorResult> results;
private Logger logger = Logger.getLogger(Monitor.class);
private TestPlanFactory testPlanFactory;
private MonitorMessenger monitorMessenger;
@Autowired
private void setMonitorMessenger(MonitorMessenger monitorMessenger) {
this.monitorMessenger = monitorMessenger;
}
public Monitor() {
this.results = new HashSet<MonitorResult>();
}
@ -111,7 +105,7 @@ public class Monitor {
return ApplicationContextHelper.getContext().getBean(
TestMonitorSampler.class);
}
@Transient
public TestPlanFactory getTestPlanFactory() {
return testPlanFactory;
@ -144,7 +138,7 @@ public class Monitor {
}
public void start(UUID testPlanId, String limitModel){
monitorMessenger.startMonitor(hostName, port, testPlanId, limitModel);
this.getTestMonitorSampler().startMonitor(hostName, port, testPlanId, limitModel);
}
public List<MonitorResult> createFinishedResult() {

View File

@ -1,5 +1,7 @@
package org.bench4q.master.domain.valueobject.datastatistics;
import java.util.UUID;
import org.bench4q.master.infrastructure.communication.MonitorMessenger;
import org.bench4q.share.models.monitor.MonitorMain;
import org.springframework.beans.factory.annotation.Autowired;
@ -19,4 +21,7 @@ public class TestMonitorSampler {
return this.monitorMessenger.monitorModel(hostName, port);
}
public boolean startMonitor(String hostName, int port, UUID testPlanId, String limitModel){
return this.monitorMessenger.startMonitor(hostName, port, testPlanId, limitModel);
}
}

View File

@ -5,13 +5,15 @@ import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement
public class LimitModel {
@XmlElementWrapper
@XmlElement
private List<ParameterModel> params;
@XmlElementWrapper(name = "limitParameterList")
@XmlElement(name = "limitParameter")
public List<ParameterModel> getParams() {
return params;
}
@ -20,7 +22,9 @@ public class LimitModel {
this.params = params;
}
@XmlRootElement
@XmlType(name = "limitParameterModel")
public static class ParameterModel {
private String name;
private double limit;