use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo in project pinpoint by naver.
the class JoinDataSourceSampler method sampleDataPoints.
@Override
public AggreJoinDataSourceListBo sampleDataPoints(int index, long timestamp, List<JoinDataSourceListBo> joinDataSourceListBoList, JoinDataSourceListBo previousJoinDataSourceListBo) {
if (CollectionUtils.isEmpty(joinDataSourceListBoList)) {
return AggreJoinDataSourceListBo.createUncollectedObject(timestamp);
}
JoinDataSourceListBo joinDataSourceListBo = JoinDataSourceListBo.joinDataSourceListBoList(joinDataSourceListBoList, timestamp);
String id = joinDataSourceListBo.getId();
List<JoinDataSourceBo> joinDataSourceBoList = joinDataSourceListBo.getJoinDataSourceBoList();
List<JoinDataSourceBo> aggreJoinDataSourceBoList = getJoinDataSourceBoList(timestamp, joinDataSourceBoList);
AggreJoinDataSourceListBo aggreJoinDataSourceListBo = new AggreJoinDataSourceListBo(id, aggreJoinDataSourceBoList, timestamp);
return aggreJoinDataSourceListBo;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo in project pinpoint by naver.
the class DataSourceCodecTest method createJoinDataSourceListBoList.
private List<JoinStatBo> createJoinDataSourceListBoList(long currentTime) {
final String id = "test_app";
List<JoinStatBo> joinDataSourceListBoList = new ArrayList<>();
JoinDataSourceListBo joinDataSourceListBo1 = new JoinDataSourceListBo(id, createJoinDataSourceBoList(10), currentTime);
JoinDataSourceListBo joinDataSourceListBo2 = new JoinDataSourceListBo(id, createJoinDataSourceBoList(20), currentTime + 5000);
JoinDataSourceListBo joinDataSourceListBo3 = new JoinDataSourceListBo(id, createJoinDataSourceBoList(30), currentTime + 10000);
JoinDataSourceListBo joinDataSourceListBo4 = new JoinDataSourceListBo(id, createJoinDataSourceBoList(40), currentTime + 15000);
JoinDataSourceListBo joinDataSourceListBo5 = new JoinDataSourceListBo(id, createJoinDataSourceBoList(50), currentTime + 20000);
joinDataSourceListBoList.add(joinDataSourceListBo1);
joinDataSourceListBoList.add(joinDataSourceListBo2);
joinDataSourceListBoList.add(joinDataSourceListBo3);
joinDataSourceListBoList.add(joinDataSourceListBo4);
joinDataSourceListBoList.add(joinDataSourceListBo5);
return joinDataSourceListBoList;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo in project pinpoint by naver.
the class DataSourceCodec method encodeTimestamps.
private void encodeTimestamps(Buffer valueBuffer, List<JoinDataSourceListBo> joinDataSourceListBoList) {
List<Long> timestamps = new ArrayList<Long>(joinDataSourceListBoList.size());
for (JoinDataSourceListBo joinDataSourceListBo : joinDataSourceListBoList) {
timestamps.add(joinDataSourceListBo.getTimestamp());
}
codec.encodeTimestamps(valueBuffer, timestamps);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo in project pinpoint by naver.
the class JoinDataSourceListBoMapperTest method map2Test.
@Test
public void map2Test() {
JoinDataSourceListBoMapper mapper = new JoinDataSourceListBoMapper();
TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId("testAgent");
tFAgentStat.setTimestamp(1491274138454L);
JoinDataSourceListBo joinDataSourceListBo = mapper.map(tFAgentStat);
assertEquals(joinDataSourceListBo, JoinDataSourceListBo.EMPTY_JOIN_DATA_SOURCE_LIST_BO);
TFDataSourceList tFDataSourceList = new TFDataSourceList();
tFAgentStat.setDataSourceList(tFDataSourceList);
joinDataSourceListBo = mapper.map(tFAgentStat);
assertEquals(joinDataSourceListBo, JoinDataSourceListBo.EMPTY_JOIN_DATA_SOURCE_LIST_BO);
List<TFDataSource> dataSourceList = new ArrayList<>();
tFDataSourceList.setDataSourceList(dataSourceList);
joinDataSourceListBo = mapper.map(tFAgentStat);
assertEquals(joinDataSourceListBo, JoinDataSourceListBo.EMPTY_JOIN_DATA_SOURCE_LIST_BO);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo in project pinpoint by naver.
the class JoinDataSourceListBoMapper method build.
@Override
public void build(TFAgentStat tFAgentStat, JoinAgentStatBo.Builder builder) {
JoinDataSourceListBo joinDataSourceListBo = this.map(tFAgentStat);
if (joinDataSourceListBo == JoinDataSourceListBo.EMPTY_JOIN_DATA_SOURCE_LIST_BO) {
return;
}
builder.addDataSourceListBo(joinDataSourceListBo);
}
Aggregations