Search in sources :

Example 1 with JoinTransactionBo

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;
}
Also used : ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo) JoinTransactionBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo)

Example 2 with JoinTransactionBo

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

Example 3 with 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;
}
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 4 with 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());
}
Also used : UnsignedLongEncodingStrategy(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.UnsignedLongEncodingStrategy) ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo) JoinLongFieldStrategyAnalyzer(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldStrategyAnalyzer) StrategyAnalyzer(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.StrategyAnalyzer) JoinLongFieldStrategyAnalyzer(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldStrategyAnalyzer) JoinTransactionBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo)

Example 5 with JoinTransactionBo

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));
}
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)

Aggregations

JoinTransactionBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo)12 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)7 ArrayList (java.util.ArrayList)5 Test (org.junit.Test)4 JoinStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo)3 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)3 TFTransaction (com.navercorp.pinpoint.thrift.dto.flink.TFTransaction)3 AggreJoinTransactionBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo)3 AgentStatHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder)1 BitCountingHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder)1 JoinLongFieldEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldEncodingStrategy)1 JoinLongFieldStrategyAnalyzer (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldStrategyAnalyzer)1 StrategyAnalyzer (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.StrategyAnalyzer)1 UnsignedLongEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.UnsignedLongEncodingStrategy)1 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)1 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)1