Search in sources :

Example 46 with JoinLongFieldBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.

the class TransactionCodec method decodeValues.

@Override
public List<JoinStatBo> decodeValues(Buffer valueBuffer, ApplicationStatDecodingContext decodingContext) {
    final String id = decodingContext.getApplicationId();
    final long baseTimestamp = decodingContext.getBaseTimestamp();
    final long timestampDelta = decodingContext.getTimestampDelta();
    final long initialTimestamp = baseTimestamp + timestampDelta;
    int numValues = valueBuffer.readVInt();
    List<Long> timestampList = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
    // decode headers
    final byte[] header = valueBuffer.readPrefixedBytes();
    AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
    EncodingStrategy<Long> collectIntervalEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
    JoinLongFieldEncodingStrategy totalCountEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
    List<Long> collectIntervalList = this.codec.decodeValues(valueBuffer, collectIntervalEncodingStrategy, numValues);
    final List<JoinLongFieldBo> totalCountList = this.codec.decodeValues(valueBuffer, totalCountEncodingStrategy, numValues);
    List<JoinStatBo> joinTransactionBoList = new ArrayList<>();
    for (int i = 0; i < numValues; i++) {
        JoinTransactionBo joinTransactionBo = new JoinTransactionBo();
        joinTransactionBo.setId(id);
        joinTransactionBo.setTimestamp(timestampList.get(i));
        joinTransactionBo.setCollectInterval(collectIntervalList.get(i));
        joinTransactionBo.setTotalCountJoinValue(totalCountList.get(i));
        joinTransactionBoList.add(joinTransactionBo);
    }
    return joinTransactionBoList;
}
Also used : BitCountingHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder) ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo) JoinLongFieldEncodingStrategy(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldEncodingStrategy) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) AgentStatHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder) JoinTransactionBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo)

Example 47 with JoinLongFieldBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.

the class JoinDirectBufferBoMapperTest method mapTest.

@Test
public void mapTest() throws Exception {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId("testAgent");
    tFAgentStat.setTimestamp(1491274138454L);
    final TFDirectBuffer tfDirectBuffer = new TFDirectBuffer();
    tfDirectBuffer.setDirectCount(10);
    tfDirectBuffer.setDirectMemoryUsed(11);
    tfDirectBuffer.setMappedCount(12);
    tfDirectBuffer.setMappedMemoryUsed(13);
    tFAgentStat.setDirectBuffer(tfDirectBuffer);
    final JoinDirectBufferBoMapper mapper = new JoinDirectBufferBoMapper();
    final JoinDirectBufferBo joinDirectBufferBo = mapper.map(tFAgentStat);
    assertNotNull(joinDirectBufferBo);
    assertEquals(joinDirectBufferBo.getId(), "testAgent");
    assertEquals(joinDirectBufferBo.getTimestamp(), 1491274138454L);
    final JoinLongFieldBo directCountJoinValue = joinDirectBufferBo.getDirectCountJoinValue();
    assertEquals(directCountJoinValue.getAvg(), 10, 0);
    assertEquals(directCountJoinValue.getMin(), 10, 0);
    assertEquals(directCountJoinValue.getMax(), 10, 0);
    final JoinLongFieldBo directMemoryUsedJoinValue = joinDirectBufferBo.getDirectMemoryUsedJoinValue();
    assertEquals(directMemoryUsedJoinValue.getAvg(), 11, 0);
    assertEquals(directMemoryUsedJoinValue.getMin(), 11, 0);
    assertEquals(directMemoryUsedJoinValue.getMax(), 11, 0);
    final JoinLongFieldBo mappedCountJoinValue = joinDirectBufferBo.getMappedCountJoinValue();
    assertEquals(mappedCountJoinValue.getAvg(), 12, 0);
    assertEquals(mappedCountJoinValue.getMin(), 12, 0);
    assertEquals(mappedCountJoinValue.getMax(), 12, 0);
    final JoinLongFieldBo mappedMemoryUsedJoinValue = joinDirectBufferBo.getMappedMemoryUsedJoinValue();
    assertEquals(mappedMemoryUsedJoinValue.getAvg(), 13, 0);
    assertEquals(mappedMemoryUsedJoinValue.getMin(), 13, 0);
    assertEquals(mappedMemoryUsedJoinValue.getMax(), 13, 0);
}
Also used : JoinDirectBufferBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinDirectBufferBo) TFDirectBuffer(com.navercorp.pinpoint.thrift.dto.flink.TFDirectBuffer) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Test(org.junit.Test)

Example 48 with JoinLongFieldBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.

the class JoinResponseTimeBoMapperTest method mapTest.

@Test
public void mapTest() {
    final String agentId = "agentId";
    final TFResponseTime tFResponseTime = new TFResponseTime();
    tFResponseTime.setAvg(100);
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId(agentId);
    tFAgentStat.setTimestamp(1491274148454L);
    tFAgentStat.setResponseTime(tFResponseTime);
    JoinResponseTimeBoMapper mapper = new JoinResponseTimeBoMapper();
    JoinResponseTimeBo joinResponseTimeBo = mapper.map(tFAgentStat);
    assertEquals(joinResponseTimeBo.getId(), agentId);
    assertEquals(joinResponseTimeBo.getTimestamp(), 1491274148454L);
    assertEquals(joinResponseTimeBo.getResponseTimeJoinValue(), new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId));
}
Also used : JoinResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) TFResponseTime(com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime) Test(org.junit.Test)

Example 49 with JoinLongFieldBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.

the class JoinTransactionBoMapperTest method mapTest.

@Test
public void mapTest() throws Exception {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    final String id = "testAgent";
    tFAgentStat.setAgentId(id);
    tFAgentStat.setTimestamp(1491274138454L);
    tFAgentStat.setCollectInterval(5000);
    final TFTransaction tFTransaction = new TFTransaction();
    tFTransaction.setSampledNewCount(10);
    tFTransaction.setSampledContinuationCount(20);
    tFTransaction.setUnsampledNewCount(40);
    tFTransaction.setUnsampledContinuationCount(50);
    tFTransaction.setSkippedNewCount(60);
    tFTransaction.setSkippedContinuationCount(70);
    tFAgentStat.setTransaction(tFTransaction);
    final JoinTransactionBoMapper joinTransactionBoMapper = new JoinTransactionBoMapper();
    final JoinTransactionBo joinTransactionBo = joinTransactionBoMapper.map(tFAgentStat);
    assertNotNull(joinTransactionBo);
    assertEquals(joinTransactionBo.getId(), id);
    assertEquals(joinTransactionBo.getTimestamp(), 1491274138454L);
    assertEquals(joinTransactionBo.getCollectInterval(), 5000);
    assertEquals(joinTransactionBo.getTotalCountJoinValue(), new JoinLongFieldBo(250L, 250L, id, 250L, id));
}
Also used : TFTransaction(com.navercorp.pinpoint.thrift.dto.flink.TFTransaction) 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) Test(org.junit.Test)

Example 50 with JoinLongFieldBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.

the class JoinTotalThreadCountBoMapperTest method mapTest.

@Test
public void mapTest() throws Exception {
    final TFAgentStat tFAgentStat = new TFAgentStat();
    tFAgentStat.setAgentId("testAgent");
    tFAgentStat.setTimestamp(1491274138454L);
    final TFTotalThreadCount tfTotalThreadCount = new TFTotalThreadCount();
    tfTotalThreadCount.setTotalThreadCount(50);
    tFAgentStat.setTotalThreadCount(tfTotalThreadCount);
    final JoinTotalThreadCountBoMapper mapper = new JoinTotalThreadCountBoMapper();
    final JoinTotalThreadCountBo joinTotalThreadCountBo = mapper.map(tFAgentStat);
    assertNotNull(joinTotalThreadCountBo);
    assertEquals(joinTotalThreadCountBo.getId(), "testAgent");
    assertEquals(joinTotalThreadCountBo.getTimestamp(), 1491274138454L);
    assertEquals(joinTotalThreadCountBo.getTotalThreadCountJoinValue(), new JoinLongFieldBo(50L, 50L, "testAgent", 50L, "testAgent"));
}
Also used : JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) TFAgentStat(com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) TFTotalThreadCount(com.navercorp.pinpoint.thrift.dto.flink.TFTotalThreadCount) Test(org.junit.Test)

Aggregations

JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)54 ArrayList (java.util.ArrayList)18 Test (org.junit.Test)18 TFAgentStat (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat)10 AgentStatHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder)8 BitCountingHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder)8 JoinLongFieldEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldEncodingStrategy)8 JoinStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo)8 JoinResponseTimeBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo)7 JoinTransactionBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo)7 JoinDirectBufferBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinDirectBufferBo)6 JoinLoadedClassBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLoadedClassBo)6 JoinTotalThreadCountBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo)6 JoinMemoryBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo)5 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)4 JoinFileDescriptorBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinFileDescriptorBo)4 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)4 Date (java.util.Date)4 TFResponseTime (com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime)3 TFTransaction (com.navercorp.pinpoint.thrift.dto.flink.TFTransaction)3