Search in sources :

Example 6 with JoinTotalThreadCountBo

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

the class JoinTotalThreadSamplerTest method sampleDataPoints.

@Test
public void sampleDataPoints() {
    JoinTotalThreadCountSampler joinTotalThreadCountSampler = new JoinTotalThreadCountSampler();
    List<JoinTotalThreadCountBo> joinTotalThreadCountBoList = new ArrayList<>(5);
    long timeStamp = new Date().getTime();
    joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 5000, 11, 60, "agent1_1", 20, "agent1_2"));
    joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 10000, 22, 52, "agent2_1", 10, "agent2_2"));
    joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 15000, 33, 39, "agent3_1", 90, "agent3_2"));
    joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 20000, 44, 42, "agent4_1", 25, "agent4_2"));
    joinTotalThreadCountBoList.add(new JoinTotalThreadCountBo("testApp", timeStamp + 25000, 55, 55, "agent5_1", 54, "agent5_2"));
    AggreJoinTotalThreadCountBo aggreJoinTotalThraedCountBo = joinTotalThreadCountSampler.sampleDataPoints(0, new Date().getTime(), joinTotalThreadCountBoList, new JoinTotalThreadCountBo());
    assertEquals(aggreJoinTotalThraedCountBo.getId(), "testApp");
    assertEquals(aggreJoinTotalThraedCountBo.getTotalThreadCountJoinValue(), new JoinLongFieldBo(33L, 39L, "agent3_1", 90L, "agent3_2"));
}
Also used : AggreJoinTotalThreadCountBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo) ArrayList(java.util.ArrayList) AggreJoinTotalThreadCountBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo) JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Date(java.util.Date) Test(org.junit.Test)

Example 7 with JoinTotalThreadCountBo

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

the class TotalThreadCountCodecTest method createJoinTotalThreadCountBoList.

private List<JoinStatBo> createJoinTotalThreadCountBoList(long currentTime) {
    final String id = "test_app";
    final List<JoinStatBo> joinTotalThreadCountBoList = new ArrayList<>();
    JoinTotalThreadCountBo joinTotalThreadCountBo1 = new JoinTotalThreadCountBo(id, currentTime, 80, 1000, "agent1_1", 30, "agent1_2");
    JoinTotalThreadCountBo joinTotalThreadCountBo2 = new JoinTotalThreadCountBo(id, currentTime + 5000, 70, 900, "agent2_1", 20, "agent2_2");
    JoinTotalThreadCountBo joinTotalThreadCountBo3 = new JoinTotalThreadCountBo(id, currentTime + 15000, 60, 800, "agent4_1", 15, "agent4_2");
    JoinTotalThreadCountBo joinTotalThreadCountBo4 = new JoinTotalThreadCountBo(id, currentTime + 10000, 50, 700, "agent3_1", 10, "agent3_2");
    JoinTotalThreadCountBo joinTotalThreadCountBo5 = new JoinTotalThreadCountBo(id, currentTime + 20000, 40, 600, "agent5_1", 5, "agent5_2");
    joinTotalThreadCountBoList.add(joinTotalThreadCountBo1);
    joinTotalThreadCountBoList.add(joinTotalThreadCountBo2);
    joinTotalThreadCountBoList.add(joinTotalThreadCountBo3);
    joinTotalThreadCountBoList.add(joinTotalThreadCountBo4);
    joinTotalThreadCountBoList.add(joinTotalThreadCountBo5);
    return joinTotalThreadCountBoList;
}
Also used : ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo) JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo)

Example 8 with JoinTotalThreadCountBo

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

the class TotalThreadCountCodec method encodeValues.

@Override
public void encodeValues(Buffer valueBuffer, List<JoinStatBo> joinTotalThreadCountBoList) {
    if (CollectionUtils.isEmpty(joinTotalThreadCountBoList)) {
        throw new IllegalArgumentException("joinTotalThreadCountBoList must not be empty");
    }
    final int numValues = joinTotalThreadCountBoList.size();
    valueBuffer.putVInt(numValues);
    List<Long> timestamps = new ArrayList<Long>(numValues);
    JoinLongFieldStrategyAnalyzer.Builder totalThreadCountAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
    for (JoinStatBo joinStatBo : joinTotalThreadCountBoList) {
        JoinTotalThreadCountBo joinTotalThreadCountBo = (JoinTotalThreadCountBo) joinStatBo;
        timestamps.add(joinTotalThreadCountBo.getTimestamp());
        totalThreadCountAnalyzerBuilder.addValue(joinTotalThreadCountBo.getTotalThreadCountJoinValue());
    }
    codec.encodeTimestamps(valueBuffer, timestamps);
    encodeDataPoints(valueBuffer, totalThreadCountAnalyzerBuilder.build());
}
Also used : JoinLongFieldStrategyAnalyzer(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldStrategyAnalyzer) ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo) JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo)

Example 9 with JoinTotalThreadCountBo

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo 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)

Example 10 with JoinTotalThreadCountBo

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

the class JoinTotalThreadCountBoMapper method map.

@Override
public JoinTotalThreadCountBo map(TFAgentStat tFAgentStat) {
    if (!tFAgentStat.isSetTotalThreadCount()) {
        return JoinTotalThreadCountBo.EMPTY_TOTAL_THREAD_COUNT_BO;
    }
    JoinTotalThreadCountBo joinTotalThreadCountBo = new JoinTotalThreadCountBo();
    final String agentId = tFAgentStat.getAgentId();
    final long totalThreadCount = tFAgentStat.getTotalThreadCount().getTotalThreadCount();
    joinTotalThreadCountBo.setId(agentId);
    joinTotalThreadCountBo.setTimestamp(tFAgentStat.getTimestamp());
    joinTotalThreadCountBo.setTotalThreadCountJoinValue(new JoinLongFieldBo(totalThreadCount, totalThreadCount, agentId, totalThreadCount, agentId));
    return joinTotalThreadCountBo;
}
Also used : JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Aggregations

JoinTotalThreadCountBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo)10 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)6 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 TFTotalThreadCount (com.navercorp.pinpoint.thrift.dto.flink.TFTotalThreadCount)2 AggreJoinTotalThreadCountBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo)2 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 JoinAgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinAgentStatBo)1 TFAgentStatBatch (com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch)1 Date (java.util.Date)1