use of com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentUriStatChart in project pinpoint by naver.
the class AgentUriStatChartService method selectAgentChartList.
@Override
public List<StatChart> selectAgentChartList(String agentId, TimeWindow timeWindow) {
Objects.requireNonNull(agentId, "agentId");
Objects.requireNonNull(timeWindow, "timeWindow");
List<SampledAgentUriStat> sampledAgentUriStatList = sampledAgentUriStatDao.getSampledAgentStatList(agentId, timeWindow);
if (CollectionUtils.isEmpty(sampledAgentUriStatList)) {
return Arrays.asList(new AgentUriStatChart(timeWindow, Collections.emptyList()));
} else {
List<StatChart> result = new ArrayList<>(sampledAgentUriStatList.size());
for (SampledAgentUriStat sampledAgentUriStat : sampledAgentUriStatList) {
result.add(new AgentUriStatChart(timeWindow, sampledAgentUriStat.getSampledEachUriStatBoList()));
}
Collections.sort(result, new Comparator<StatChart>() {
@Override
public int compare(StatChart o1, StatChart o2) {
AgentUriStatChart chart1 = (AgentUriStatChart) o1;
AgentUriStatChart chart2 = (AgentUriStatChart) o2;
return Long.compare(chart2.getTotalCount(), chart1.getTotalCount());
}
});
return result;
}
}
use of com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentUriStatChart in project pinpoint by naver.
the class AgentUriStatChartService method selectAgentChart.
@Override
public StatChart selectAgentChart(String agentId, TimeWindow timeWindow) {
Objects.requireNonNull(agentId, "agentId");
Objects.requireNonNull(timeWindow, "timeWindow");
List<SampledAgentUriStat> sampledAgentUriStatList = sampledAgentUriStatDao.getSampledAgentStatList(agentId, timeWindow);
if (CollectionUtils.isEmpty(sampledAgentUriStatList)) {
return new AgentUriStatChart(timeWindow, Collections.emptyList());
} else {
SampledAgentUriStat first = CollectionUtils.firstElement(sampledAgentUriStatList);
return new AgentUriStatChart(timeWindow, first.getSampledEachUriStatBoList());
}
}
Aggregations