use of com.navercorp.pinpoint.thrift.dto.flink.TFTransaction in project pinpoint by naver.
the class TFTransactionMapperTest method mapTest.
@Test
public void mapTest() {
TFTransactionMapper tFTransactionMapper = new TFTransactionMapper();
TransactionBo transactionBo = new TransactionBo();
transactionBo.setSampledContinuationCount(5);
transactionBo.setUnsampledContinuationCount(6);
transactionBo.setSampledNewCount(11);
transactionBo.setUnsampledNewCount(10);
transactionBo.setSkippedNewSkipCount(11);
transactionBo.setSkippedContinuationCount(5);
TFTransaction tFtransaction = tFTransactionMapper.map(transactionBo);
assertEquals(5, tFtransaction.getSampledContinuationCount());
assertEquals(6, tFtransaction.getUnsampledContinuationCount());
assertEquals(11, tFtransaction.getSampledNewCount());
assertEquals(10, tFtransaction.getUnsampledNewCount());
assertEquals(11, tFtransaction.getSkippedNewCount());
assertEquals(5, tFtransaction.getSkippedContinuationCount());
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFTransaction 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.thrift.dto.flink.TFTransaction in project pinpoint by naver.
the class TBaseFlatMapperTest method createTFAgentStatBatch3.
private TFAgentStatBatch createTFAgentStatBatch3() {
final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
tFAgentStatBatch.setStartTimestamp(1491274142454L);
tFAgentStatBatch.setAgentId(AGENT_ID);
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(AGENT_ID);
tFAgentStat.setTimestamp(1491274143454L);
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(AGENT_ID);
tFAgentStat2.setTimestamp(1491274148454L);
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);
return tFAgentStatBatch;
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFTransaction 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));
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFTransaction in project pinpoint by naver.
the class TFTransactionMapper method map.
public TFTransaction map(TransactionBo transactionBo) {
TFTransaction tFTransaction = new TFTransaction();
tFTransaction.setSampledNewCount(transactionBo.getSampledNewCount());
tFTransaction.setSampledContinuationCount(transactionBo.getSampledContinuationCount());
tFTransaction.setUnsampledNewCount(transactionBo.getUnsampledNewCount());
tFTransaction.setUnsampledContinuationCount(transactionBo.getUnsampledContinuationCount());
tFTransaction.setSkippedNewCount(transactionBo.getSkippedNewSkipCount());
tFTransaction.setSkippedContinuationCount(transactionBo.getSkippedContinuationCount());
return tFTransaction;
}
Aggregations