refactor
This commit is contained in:
coderfengyun 2014-09-19 14:30:56 +08:00
parent b0faf5b729
commit 39ea7f7b10
2 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,6 @@
package org.bench4q.monitor.api;
import java.util.HashMap;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
@ -17,6 +18,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/monitor")
public class MainController {
private HashMap<UUID, LimitModel> submitedLimits = new HashMap<UUID, LimitModel>();
@RequestMapping("/all")
@ResponseBody
MonitorMain getMainModel() throws SigarException, InterruptedException,
@ -35,13 +38,14 @@ public class MainController {
@ResponseBody
public String submitLimit(@PathVariable UUID testPlanId,
@RequestBody LimitModel limits) {
return new String("startted");
this.submitedLimits.put(testPlanId, limits);
return testPlanId.toString();
}
@RequestMapping(value = "/{testPlanId}", method = RequestMethod.GET)
@ResponseBody
MonitorMain brief(@PathVariable UUID testPlanId) throws SigarException,
InterruptedException, ExecutionException {
return new MonitorMain();
return new MonitorMain(this.submitedLimits.get(testPlanId));
}
}

View File

@ -56,6 +56,10 @@ public class MonitorMain extends SampleModel{
System.out.println(System.currentTimeMillis() - startTime);
}
public MonitorMain(LimitModel limitModel) {
}
public void setProcesssModel(ProcessModel processModel) {
this.processModel = processModel;
}