use of com.navercorp.pinpoint.web.mapper.stat.sampling.EagerSamplingHandler in project pinpoint by naver.
the class SampledDataSourceResultExtractor method getSampleData.
private SampledDataSourceList getSampleData(List<DataSourceBo> dataSourceBoList) {
Collections.sort(dataSourceBoList, new Comparator<DataSourceBo>() {
@Override
public int compare(DataSourceBo o1, DataSourceBo o2) {
return Long.compare(o2.getTimestamp(), o1.getTimestamp());
}
});
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.mapper.stat.sampling.EagerSamplingHandler in project pinpoint by naver.
the class SampledAgentStatResultExtractor method extractData.
@Override
public List<S> extractData(ResultScanner results) throws Exception {
int rowNum = 0;
AgentStatSamplingHandler<T, S> samplingHandler = new EagerSamplingHandler<>(timeWindow, sampler);
for (Result result : results) {
for (T dataPoint : this.rowMapper.mapRow(result, rowNum++)) {
samplingHandler.addDataPoint(dataPoint);
}
}
return samplingHandler.getSampledDataPoints();
}
Aggregations