use of com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList in project pinpoint by naver.
the class SampledDataSourceResultExtractor method getSampleData.
private SampledDataSourceList getSampleData(List<DataSourceBo> dataSourceBoList) {
dataSourceBoList.sort(Comparator.comparingLong(DataSourceBo::getTimestamp).reversed());
AgentStatSamplingHandler<DataSourceBo, SampledDataSource> samplingHandler = new EagerSamplingHandler<>(timeWindow, sampler);
for (DataSourceBo dataSourceBo : dataSourceBoList) {
samplingHandler.addDataPoint(dataSourceBo);
}
List<SampledDataSource> sampledDataSources = samplingHandler.getSampledDataPoints();
SampledDataSourceList sampledDataSourceList = new SampledDataSourceList();
for (SampledDataSource sampledDataSource : sampledDataSources) {
sampledDataSourceList.addSampledDataSource(sampledDataSource);
}
return sampledDataSourceList;
}
use of com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList in project pinpoint by naver.
the class DataSourceChartService method selectAgentChartList.
@Override
public List<StatChart> selectAgentChartList(String agentId, TimeWindow timeWindow) {
Objects.requireNonNull(agentId, "agentId");
Objects.requireNonNull(timeWindow, "timeWindow");
List<SampledDataSourceList> sampledAgentStatList = this.sampledDataSourceDao.getSampledAgentStatList(agentId, timeWindow);
if (CollectionUtils.isEmpty(sampledAgentStatList)) {
List<StatChart> result = new ArrayList<>(1);
result.add(new DataSourceChart(timeWindow, Collections.emptyList(), serviceTypeRegistryService));
return result;
} else {
List<StatChart> result = new ArrayList<>(sampledAgentStatList.size());
for (SampledDataSourceList sampledDataSourceList : sampledAgentStatList) {
result.add(new DataSourceChart(timeWindow, sampledDataSourceList.getSampledDataSourceList(), serviceTypeRegistryService));
}
return result;
}
}
Aggregations