Search in sources :

Example 1 with TFTransaction

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());
}
Also used : TFTransaction(com.navercorp.pinpoint.thrift.dto.flink.TFTransaction) TransactionBo(com.navercorp.pinpoint.common.server.bo.stat.TransactionBo) Test(org.junit.Test)

Example 2 with TFTransaction

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;
}
Also used : TFTransaction(com.navercorp.pinpoint.thrift.dto.flink.TFTransaction) JoinTransactionBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Example 3 with TFTransaction

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;
}
Also used : TFTransaction(com.navercorp.pinpoint.thrift.dto.flink.TFTransaction) ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)

Example 4 with TFTransaction

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));
}
Also used : JoinAgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo) TFTransaction(com.navercorp.pinpoint.thrift.dto.flink.TFTransaction) ArrayList(java.util.ArrayList) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinTransactionBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) TFAgentStatBatch(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch) Test(org.junit.Test)

Example 5 with TFTransaction

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;
}
Also used : TFTransaction(com.navercorp.pinpoint.thrift.dto.flink.TFTransaction)

Aggregations

TFTransaction (com.navercorp.pinpoint.thrift.dto.flink.TFTransaction)6 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)3 JoinTransactionBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo)3 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)3 Test (org.junit.Test)3 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)2 ArrayList (java.util.ArrayList)2 TransactionBo (com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)1 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)1