use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo in project pinpoint by naver.
the class TransactionCodecTest method createJoinTransactionBoList.
private List<JoinStatBo> createJoinTransactionBoList(long currentTime) {
final String id = "test_app";
List<JoinStatBo> joinTransactionBoList = new ArrayList<JoinStatBo>();
JoinTransactionBo joinTransactionBo1 = new JoinTransactionBo(id, 5000, 150, 10, "app_1_1", 230, "app_1_2", currentTime);
JoinTransactionBo joinTransactionBo2 = new JoinTransactionBo(id, 10000, 110, 22, "app_2_1", 330, "app_2_2", currentTime + 5000);
JoinTransactionBo joinTransactionBo3 = new JoinTransactionBo(id, 15000, 120, 24, "app_3_1", 540, "app_3_2", currentTime + 10000);
JoinTransactionBo joinTransactionBo4 = new JoinTransactionBo(id, 20000, 130, 25, "app_4_1", 560, "app_4_2", currentTime + 15000);
JoinTransactionBo joinTransactionBo5 = new JoinTransactionBo(id, 25000, 140, 12, "app_5_1", 260, "app_5_2", currentTime + 20000);
joinTransactionBoList.add(joinTransactionBo1);
joinTransactionBoList.add(joinTransactionBo2);
joinTransactionBoList.add(joinTransactionBo3);
joinTransactionBoList.add(joinTransactionBo4);
joinTransactionBoList.add(joinTransactionBo5);
return joinTransactionBoList;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo in project pinpoint by naver.
the class JoinTransactionBoMapper method build.
@Override
public void build(TFAgentStat tFAgentStat, JoinAgentStatBo.Builder builder) {
JoinTransactionBo joinTransactionBo = this.map(tFAgentStat);
if (joinTransactionBo == JoinTransactionBo.EMPTY_JOIN_TRANSACTION_BO) {
return;
}
builder.addTransaction(joinTransactionBo);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo in project pinpoint by naver.
the class JoinTransactionBoMapper method map.
@Override
public JoinTransactionBo map(TFAgentStat tFAgentStat) {
if (!tFAgentStat.isSetTransaction()) {
return JoinTransactionBo.EMPTY_JOIN_TRANSACTION_BO;
}
TFTransaction tFtransaction = tFAgentStat.getTransaction();
final long totalCount = calculateTotalCount(tFtransaction);
final String agentId = tFAgentStat.getAgentId();
JoinTransactionBo joinTransactionBo = new JoinTransactionBo();
joinTransactionBo.setId(agentId);
joinTransactionBo.setCollectInterval(tFAgentStat.getCollectInterval());
joinTransactionBo.setTimestamp(tFAgentStat.getTimestamp());
joinTransactionBo.setTotalCountJoinValue(new JoinLongFieldBo(totalCount, totalCount, agentId, totalCount, agentId));
return joinTransactionBo;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo in project pinpoint by naver.
the class TransactionCodec method encodeValues.
@Override
public void encodeValues(Buffer valueBuffer, List<JoinStatBo> joinTransactionBoList) {
if (CollectionUtils.isEmpty(joinTransactionBoList)) {
throw new IllegalArgumentException("joinTransactionBoList must not be empty");
}
final int numValues = joinTransactionBoList.size();
valueBuffer.putVInt(numValues);
List<Long> timestamps = new ArrayList<>(numValues);
UnsignedLongEncodingStrategy.Analyzer.Builder collectIntervalAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
JoinLongFieldStrategyAnalyzer.Builder totalCountAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
for (JoinStatBo joinStatBo : joinTransactionBoList) {
JoinTransactionBo joinTransactionBo = (JoinTransactionBo) joinStatBo;
timestamps.add(joinTransactionBo.getTimestamp());
collectIntervalAnalyzerBuilder.addValue(joinTransactionBo.getCollectInterval());
totalCountAnalyzerBuilder.addValue(joinTransactionBo.getTotalCountJoinValue());
}
codec.encodeTimestamps(valueBuffer, timestamps);
encodeDataPoints(valueBuffer, collectIntervalAnalyzerBuilder.build(), totalCountAnalyzerBuilder.build());
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo in project pinpoint by naver.
the class JoinAgentStatBoMapperTest method map3Test.
@Test
public void map3Test() {
final String agentId = "testAgent";
final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
tFAgentStatBatch.setStartTimestamp(1491274138454L);
tFAgentStatBatch.setAgentId(agentId);
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(agentId);
tFAgentStat.setTimestamp(1491274148454L);
tFAgentStat.setCollectInterval(5000);
final TFTransaction tFTransaction = new TFTransaction();
tFTransaction.setSampledNewCount(10);
tFTransaction.setSampledContinuationCount(20);
tFTransaction.setUnsampledNewCount(40);
tFTransaction.setUnsampledContinuationCount(50);
tFAgentStat.setTransaction(tFTransaction);
final TFAgentStat tFAgentStat2 = new TFAgentStat();
tFAgentStat2.setAgentId(agentId);
tFAgentStat2.setTimestamp(1491275148454L);
tFAgentStat2.setCollectInterval(5000);
final TFTransaction tFTransaction2 = new TFTransaction();
tFTransaction2.setSampledNewCount(11);
tFTransaction2.setSampledContinuationCount(21);
tFTransaction2.setUnsampledNewCount(41);
tFTransaction2.setUnsampledContinuationCount(51);
tFAgentStat2.setTransaction(tFTransaction2);
final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
tFAgentStatList.add(tFAgentStat);
tFAgentStatList.add(tFAgentStat2);
tFAgentStatBatch.setAgentStats(tFAgentStatList);
JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
assertEquals(joinAgentStatBo.getId(), agentId);
assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274138454L);
assertEquals(joinAgentStatBo.getTimestamp(), 1491274148454L);
List<JoinTransactionBo> joinTransactionBoList = joinAgentStatBo.getJoinTransactionBoList();
assertEquals(joinTransactionBoList.size(), 2);
JoinTransactionBo joinTransactionBo = joinTransactionBoList.get(0);
assertEquals(joinTransactionBo.getId(), agentId);
assertEquals(joinTransactionBo.getTimestamp(), 1491274148454L);
assertEquals(joinTransactionBo.getCollectInterval(), 5000);
assertEquals(joinTransactionBo.getTotalCountJoinValue(), new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId));
JoinTransactionBo joinTransactionBo2 = joinTransactionBoList.get(1);
assertEquals(joinTransactionBo2.getId(), agentId);
assertEquals(joinTransactionBo2.getTimestamp(), 1491275148454L);
assertEquals(joinTransactionBo2.getCollectInterval(), 5000);
assertEquals(joinTransactionBo2.getTotalCountJoinValue(), new JoinLongFieldBo(124L, 124L, agentId, 124L, agentId));
}
Aggregations