add pages brief

This commit is contained in:
coderfengyun 2014-01-02 16:35:21 +08:00
parent 408d511b1b
commit cb69344688
1 changed files with 20 additions and 0 deletions

View File

@ -27,6 +27,7 @@ import org.bench4q.share.models.agent.StopTestModel;
import org.bench4q.share.models.agent.statistics.AgentBriefStatusModel;
import org.bench4q.share.models.agent.statistics.AgentBehaviorsBriefModel;
import org.bench4q.share.models.agent.statistics.AgentPageBriefModel;
import org.bench4q.share.models.agent.statistics.AgentPagesBriefModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
@ -128,6 +129,25 @@ public class TestController {
return behaviorBriefModel;
}
@RequestMapping(value = "/pagesBrief/{runId}")
@ResponseBody
public AgentPagesBriefModel pagesBrief(@PathVariable UUID runId) {
ScenarioContext context = this.getScenarioEngine().getRunningTests()
.get(runId);
AgentPagesBriefModel result = new AgentPagesBriefModel();
List<AgentPageBriefModel> pageBrieves = new ArrayList<AgentPageBriefModel>();
if (context == null || context.isFinished()) {
return null;
}
for (int i = 0; i < context.getScenario().getPages().length; i++) {
pageBrieves.add((AgentPageBriefModel) context.getDataStatistics()
.getPageBriefStatistics(i));
}
result.setPageBriefModels(pageBrieves);
return result;
}
@RequestMapping(value = "/pageBrief/{runId}/{pageId}")
@ResponseBody
public AgentPageBriefModel pageBrief(@PathVariable UUID runId,