use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo.DataSourceKey in project pinpoint by naver.
the class ApplicationDataSourceService method classifyByDataSourceUrl.
protected Map<DataSourceKey, List<AggreJoinDataSourceBo>> classifyByDataSourceUrl(List<AggreJoinDataSourceListBo> aggreJoinDataSourceListBoList) {
Map<DataSourceKey, List<AggreJoinDataSourceBo>> aggreJoinDataSourceBoMap = new HashMap<>();
for (AggreJoinDataSourceListBo aggreJoinDataSourceListBo : aggreJoinDataSourceListBoList) {
for (AggreJoinDataSourceBo aggreJoinDataSourceBo : aggreJoinDataSourceListBo.getAggreJoinDataSourceBoList()) {
DataSourceKey dataSourceKey = new DataSourceKey(aggreJoinDataSourceBo.getUrl(), aggreJoinDataSourceBo.getServiceTypeCode());
List<AggreJoinDataSourceBo> aggreJoinDataSourceBoList = aggreJoinDataSourceBoMap.computeIfAbsent(dataSourceKey, k -> new ArrayList<>());
aggreJoinDataSourceBoList.add(aggreJoinDataSourceBo);
}
}
for (List<AggreJoinDataSourceBo> aggreJoinDataSourceBoList : aggreJoinDataSourceBoMap.values()) {
aggreJoinDataSourceBoList.sort(comparator);
}
return aggreJoinDataSourceBoMap;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo.DataSourceKey in project pinpoint by naver.
the class ApplicationDataSourceService method selectApplicationChart.
public List<StatChart> selectApplicationChart(String applicationId, TimeWindow timeWindow) {
Objects.requireNonNull(applicationId, "applicationId");
Objects.requireNonNull(timeWindow, "timeWindow");
List<StatChart> result = new ArrayList<>();
List<AggreJoinDataSourceListBo> aggreJoinDataSourceListBoList = this.applicationDataSourceDao.getApplicationStatList(applicationId, timeWindow);
if (aggreJoinDataSourceListBoList.isEmpty()) {
result.add(new ApplicationDataSourceChart(timeWindow, "", "", Collections.emptyList()));
return result;
}
Map<DataSourceKey, List<AggreJoinDataSourceBo>> aggreJoinDataSourceBoMap = classifyByDataSourceUrl(aggreJoinDataSourceListBoList);
for (Map.Entry<DataSourceKey, List<AggreJoinDataSourceBo>> entry : aggreJoinDataSourceBoMap.entrySet()) {
DataSourceKey dataSourceKey = entry.getKey();
String serviceTypeName = serviceTypeRegistryService.findServiceType(dataSourceKey.getServiceTypeCode()).getName();
result.add(new ApplicationDataSourceChart(timeWindow, dataSourceKey.getUrl(), serviceTypeName, entry.getValue()));
}
return result;
}
Aggregations