use of com.navercorp.pinpoint.web.view.AgentResponseTimeViewModel in project pinpoint by naver.
the class AgentTimeHistogram method createAgentResponseTimeViewModel.
private AgentResponseTimeViewModel createAgentResponseTimeViewModel(Application agentName, List<TimeHistogram> timeHistogramList) {
List<ResponseTimeViewModel> responseTimeViewModel = createResponseTimeViewModel(timeHistogramList);
AgentResponseTimeViewModel agentResponseTimeViewModel = new AgentResponseTimeViewModel(agentName, responseTimeViewModel);
return agentResponseTimeViewModel;
}
use of com.navercorp.pinpoint.web.view.AgentResponseTimeViewModel in project pinpoint by naver.
the class AgentTimeHistogram method createViewModel.
public List<AgentResponseTimeViewModel> createViewModel(TimeHistogramFormat timeHistogramFormat) {
final List<AgentResponseTimeViewModel> result = new ArrayList<>();
for (AgentHistogram agentHistogram : agentHistogramList.getAgentHistogramList()) {
Application agentId = agentHistogram.getAgentId();
List<TimeHistogram> timeList = sortTimeHistogram(agentHistogram.getTimeHistogram());
AgentResponseTimeViewModel model = createAgentResponseTimeViewModel(agentId, timeList, timeHistogramFormat);
result.add(model);
}
result.sort(Comparator.comparing(AgentResponseTimeViewModel::getAgentName));
return result;
}
use of com.navercorp.pinpoint.web.view.AgentResponseTimeViewModel in project pinpoint by naver.
the class AgentTimeHistogramTest method testViewModel.
@Test
public void testViewModel() throws IOException {
Application app = new Application("test", ServiceType.STAND_ALONE);
AgentTimeHistogramBuilder builder = new AgentTimeHistogramBuilder(app, Range.newRange(0, 1000 * 60));
List<ResponseTime> responseHistogramList = createResponseTime(app, "test1", "test2");
AgentTimeHistogram histogram = builder.build(responseHistogramList);
List<AgentResponseTimeViewModel> viewModel = histogram.createViewModel(TimeHistogramFormat.V1);
logger.debug("{}", viewModel);
JsonFactory jsonFactory = mapper.getFactory();
StringWriter stringWriter = new StringWriter();
JsonGenerator jsonGenerator = jsonFactory.createGenerator(stringWriter);
jsonGenerator.writeStartObject();
for (AgentResponseTimeViewModel agentResponseTimeViewModel : viewModel) {
jsonGenerator.writeObject(agentResponseTimeViewModel);
}
jsonGenerator.writeEndObject();
jsonGenerator.flush();
jsonGenerator.close();
logger.debug(stringWriter.toString());
}
use of com.navercorp.pinpoint.web.view.AgentResponseTimeViewModel in project pinpoint by naver.
the class AgentTimeHistogram method createViewModel.
public List<AgentResponseTimeViewModel> createViewModel() {
final List<AgentResponseTimeViewModel> result = new ArrayList<>();
for (AgentHistogram agentHistogram : agentHistogramList.getAgentHistogramList()) {
Application agentId = agentHistogram.getAgentId();
List<TimeHistogram> timeList = sortTimeHistogram(agentHistogram.getTimeHistogram());
AgentResponseTimeViewModel model = createAgentResponseTimeViewModel(agentId, timeList);
result.add(model);
}
Collections.sort(result, new Comparator<AgentResponseTimeViewModel>() {
@Override
public int compare(AgentResponseTimeViewModel o1, AgentResponseTimeViewModel o2) {
return o1.getAgentName().compareTo(o2.getAgentName());
}
});
return result;
}
use of com.navercorp.pinpoint.web.view.AgentResponseTimeViewModel in project pinpoint by naver.
the class AgentTimeHistogram method createAgentResponseTimeViewModel.
private AgentResponseTimeViewModel createAgentResponseTimeViewModel(Application agentName, List<TimeHistogram> timeHistogramList, TimeHistogramFormat timeHistogramFormat) {
List<TimeViewModel> responseTimeViewModel = createResponseTimeViewModel(timeHistogramList, timeHistogramFormat);
AgentResponseTimeViewModel agentResponseTimeViewModel = new AgentResponseTimeViewModel(agentName, responseTimeViewModel);
return agentResponseTimeViewModel;
}
Aggregations