modify MonitorMain and MainController
delete unused field and fix bug MainController
This commit is contained in:
parent
810bfe7c15
commit
66b2a9bd77
|
@ -1,6 +1,8 @@
|
||||||
package org.bench4q.monitor.api;
|
package org.bench4q.monitor.api;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
|
@ -42,10 +44,14 @@ public class MainController {
|
||||||
return testPlanId.toString();
|
return testPlanId.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "/brief/{testPlanId}", method = RequestMethod.GET)
|
@RequestMapping(value = "/brief/{testPlanId}", method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
MonitorMain brief(@PathVariable UUID testPlanId) throws SigarException,
|
MonitorMain brief(@PathVariable UUID testPlanId) throws SigarException,
|
||||||
InterruptedException, ExecutionException {
|
InterruptedException, ExecutionException {
|
||||||
return new MonitorMain(this.submitedLimits.get(testPlanId));
|
LimitModel limitModel = this.submitedLimits.get(testPlanId);
|
||||||
|
if (limitModel != null)
|
||||||
|
return new MonitorMain(limitModel);
|
||||||
|
else return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.jar.Attributes.Name;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -30,8 +28,6 @@ public class MonitorMain extends SampleModel {
|
||||||
private NetworkInterfaceModel networkInterfaceModel;
|
private NetworkInterfaceModel networkInterfaceModel;
|
||||||
@XmlElement(name = "process_info")
|
@XmlElement(name = "process_info")
|
||||||
private ProcessModel processModel;
|
private ProcessModel processModel;
|
||||||
@XmlElement(name = "touch_limit")
|
|
||||||
private boolean isTouchLimit;
|
|
||||||
@XmlElement(name = "reach_limit")
|
@XmlElement(name = "reach_limit")
|
||||||
private boolean isReachLimit;
|
private boolean isReachLimit;
|
||||||
private SimpleDateFormat dateFormat = new SimpleDateFormat(
|
private SimpleDateFormat dateFormat = new SimpleDateFormat(
|
||||||
|
@ -85,6 +81,14 @@ public class MonitorMain extends SampleModel {
|
||||||
System.out.println(System.currentTimeMillis() - startTime);
|
System.out.println(System.currentTimeMillis() - startTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getIsReachLimit() {
|
||||||
|
return isReachLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsReachLimit(boolean isReachLimit) {
|
||||||
|
this.isReachLimit = isReachLimit;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean getLimitresult(LimitModel limitModel) throws SigarException {
|
private boolean getLimitresult(LimitModel limitModel) throws SigarException {
|
||||||
//LimitableFieldsModel limitableFieldsModel = new LimitableFieldsModel();
|
//LimitableFieldsModel limitableFieldsModel = new LimitableFieldsModel();
|
||||||
boolean limitResult = false;
|
boolean limitResult = false;
|
||||||
|
@ -116,11 +120,4 @@ public class MonitorMain extends SampleModel {
|
||||||
this.networkInterfaceModel = networkInterfaceModel;
|
this.networkInterfaceModel = networkInterfaceModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTouchLimit() {
|
|
||||||
return isTouchLimit;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTouchLimit(boolean isTouchLimit) {
|
|
||||||
this.isTouchLimit = isTouchLimit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue