use of com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo in project pinpoint by naver.
the class DataSourceCodecV2 method encodeValues.
@Override
public void encodeValues(Buffer valueBuffer, List<DataSourceListBo> dataSourceListBos) {
if (CollectionUtils.isEmpty(dataSourceListBos)) {
throw new IllegalArgumentException("dataSourceListBos must not be empty");
}
final int numValues = dataSourceListBos.size();
valueBuffer.putVInt(numValues);
for (DataSourceListBo dataSourceListBo : dataSourceListBos) {
encodeDataSourceListBo(valueBuffer, dataSourceListBo);
}
}
use of com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo in project pinpoint by naver.
the class DataSourceCodecV2 method decodeValues.
@Override
public List<DataSourceListBo> decodeValues(Buffer valueBuffer, AgentStatDecodingContext decodingContext) {
int numValues = valueBuffer.readVInt();
List<DataSourceListBo> dataSourceListBos = new ArrayList<DataSourceListBo>(numValues);
for (int i = 0; i < numValues; i++) {
DataSourceListBo dataSourceListBo = decodeValue(valueBuffer, decodingContext);
dataSourceListBos.add(dataSourceListBo);
}
return dataSourceListBos;
}
use of com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo in project pinpoint by naver.
the class TestAgentStatFactory method createDataSourceListBos.
public static List<DataSourceListBo> createDataSourceListBos(String agentId, long startTimestamp, long initialTimestamp, int numValues) {
List<DataSourceListBo> dataSourceListBos = new ArrayList<DataSourceListBo>(numValues);
for (int i = 0; i < numValues; ++i) {
int maxConnectionSize = RANDOM.nextInt(MIN_VALUE_OF_MAX_CONNECTION_SIZE) + MIN_VALUE_OF_MAX_CONNECTION_SIZE;
int dataSourceBoSize = RANDOM.nextInt(MAX_NUM_TEST_VALUES) + 1;
DataSourceListBo dataSourceListBo = createDataSourceListBo(agentId, startTimestamp, initialTimestamp, i + 1, maxConnectionSize, dataSourceBoSize);
dataSourceListBos.add(dataSourceListBo);
}
return dataSourceListBos;
}
use of com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo in project pinpoint by naver.
the class HbaseSampledDataSourceDaoV2 method getSampledAgentStatList.
@Override
public List<SampledDataSourceList> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
long scanFrom = timeWindow.getWindowRange().getFrom();
long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
Range range = new Range(scanFrom, scanTo);
AgentStatMapperV2<DataSourceListBo> mapper = operations.createRowMapper(dataSourceDecoder, range);
SampledDataSourceResultExtractor resultExtractor = new SampledDataSourceResultExtractor(timeWindow, mapper, dataSourceSampler);
return operations.getSampledAgentStatList(AgentStatType.DATASOURCE, resultExtractor, agentId, range);
}
use of com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo in project pinpoint by naver.
the class SampledDataSourceResultExtractor method divideByDataSourceId.
private Map<Integer, List<DataSourceBo>> divideByDataSourceId(ResultScanner results) throws Exception {
int rowNum = 0;
Map<Integer, List<DataSourceBo>> dataSourceBoListMap = new HashMap<>();
for (Result result : results) {
for (DataSourceListBo dataPoint : this.rowMapper.mapRow(result, rowNum++)) {
if (dataPoint.size() == 0) {
continue;
}
DataSourceBo first = ListUtils.getFirst(dataPoint.getList(), null);
int id = first.getId();
List<DataSourceBo> dataSourceBoList = dataSourceBoListMap.get(id);
if (dataSourceBoList == null) {
dataSourceBoList = new ArrayList<>();
dataSourceBoListMap.put(id, dataSourceBoList);
}
dataSourceBoList.addAll(dataPoint.getList());
}
}
return dataSourceBoListMap;
}
Aggregations